Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / components / realtime / agents.js
index 4b45068..7541ff9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3d5=['sort','toLowerCase','userpic','lastLoginAt','address','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','openchannelStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','http','client','faxPause','mailPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','smsStatus','whatsappStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','*pause','busy','isArray','startCase','getAgents','all','uniq','value','getAgentIdsByQueues','includes','map','getAgentIdsByStatus','resolve','User','findAll','name','fullname','chatPause','openchannelPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter'];(function(_0x273d65,_0x2d06e6){var _0x25429a=function(_0xa90be8){while(--_0xa90be8){_0x273d65['push'](_0x273d65['shift']());}};_0x25429a(++_0x2d06e6);}(_0xf3d5,0xce));var _0x5f3d=function(_0xe1fa6b,_0x24c4c9){_0xe1fa6b=_0xe1fa6b-0x0;var _0x16e21f=_0xf3d5[_0xe1fa6b];return _0x16e21f;};'use strict';var _=require(_0x5f3d('0x0'));var jayson=require(_0x5f3d('0x1'));var db=require(_0x5f3d('0x2'))['db'];var amiClient=jayson['client'][_0x5f3d('0x3')]({'port':0x232a});var routingClient=jayson[_0x5f3d('0x4')][_0x5f3d('0x3')]({'port':0x232c});function isAgentPaused(_0x55d05c,_0x43156c){var _0x30dcc9=[_0x55d05c['chatPause'],_0x55d05c[_0x5f3d('0x5')],_0x55d05c[_0x5f3d('0x6')],_0x55d05c['openchannelPause'],_0x55d05c[_0x5f3d('0x7')],_0x55d05c[_0x5f3d('0x8')],_0x55d05c[_0x5f3d('0x9')]];if(!_0x43156c)return _['every'](_0x30dcc9);var _0x5bfd1d=_[_0x5f3d('0xa')](_0x30dcc9);return _0x5bfd1d[_0x5f3d('0xb')]>0x0&&_0x5bfd1d['length']<_0x30dcc9['length']?!![]:![];}function isIdle(_0x542aac){return _0x542aac===_0x5f3d('0xc')||_0x542aac===_0x5f3d('0xd')||_0x542aac==='unavailable'||_0x542aac==='ringing'||_[_0x5f3d('0xe')](_0x542aac);}function isAgentIdle(_0x80f2d9){if(_0x80f2d9[_0x5f3d('0xf')]!==_0x5f3d('0xc')&&_0x80f2d9[_0x5f3d('0x8')]){_0x80f2d9['voiceStatus']=_0x5f3d('0x10');return![];}return _['every']([_0x80f2d9[_0x5f3d('0x11')],_0x80f2d9[_0x5f3d('0x12')],_0x80f2d9[_0x5f3d('0x13')],_0x80f2d9['openchannelStatus'],_0x80f2d9[_0x5f3d('0x14')],_0x80f2d9['voiceStatus'],_0x80f2d9[_0x5f3d('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x5f3d('0x16')](_0x5f3d('0x17'),{})[_0x5f3d('0x18')](function(_0x1fb3a5){if(_0x1fb3a5[_0x5f3d('0x19')]){throw new Error(_0x5f3d('0x1a'));}var _0x423513=_0x1fb3a5[_0x5f3d('0x1b')];return routingClient[_0x5f3d('0x16')](_0x5f3d('0x17'),{})[_0x5f3d('0x18')](function(_0x3ec2ed){if(_0x3ec2ed['error']){throw new Error(_0x5f3d('0x1c'));}var _0xe44720=_0x3ec2ed[_0x5f3d('0x1b')];return _[_0x5f3d('0x1d')]({},_0x423513,_0xe44720);});})[_0x5f3d('0x1e')](function(_0x2b30d2){throw _0x2b30d2;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x3539f9){var _0x171aae='unknown';if(isAgentPaused(_0x3539f9))_0x171aae=_0x5f3d('0x10');else if(isAgentPaused(_0x3539f9,!![]))_0x171aae=_0x5f3d('0x1f');else if(isAgentIdle(_0x3539f9))_0x171aae=_0x5f3d('0xc');else _0x171aae=_0x5f3d('0x20');return _0x171aae;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x3cb09b,_0x1d4618){var _0x49d6c8=_[_0x5f3d('0x21')](_0x3cb09b)?_0x3cb09b:[_0x3cb09b];var _0x2a68f8=_[_0x5f3d('0x22')](_0x1d4618)+'Queue';var _0x4942eb=_['map'](_0x49d6c8,function(_0x9c9429){return db[_0x2a68f8]['findOne']({'where':{'id':_0x9c9429}})[_0x5f3d('0x18')](function(_0x110e59){if(!_0x110e59)return[];return _0x110e59[_0x5f3d('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x5f3d('0x24')](_0x4942eb)['then'](function(_0xfb8875){var _0x102b4e=_(_0xfb8875)['flatten']()['map']('id')[_0x5f3d('0x25')]()[_0x5f3d('0x26')]();return _0x102b4e;});}exports[_0x5f3d('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x432c46,_0x23aabd,_0x1b9e64){try{if(_0x23aabd[_0x5f3d('0xb')]>0x0){_0x432c46=_0x432c46[_0x5f3d('0xa')](function(_0x59e82b){return _0x23aabd[_0x5f3d('0x28')](_0x59e82b['id']);});}var _0x40bb40=_0x432c46[_0x5f3d('0xa')](function(_0x5bcc44){var _0x2b7db5=_0x5f3d('0x20');if(isAgentIdle(_0x5bcc44)){_0x2b7db5=_0x5f3d('0xc');}return _0x2b7db5===_0x1b9e64;});return _[_0x5f3d('0x29')](_0x40bb40,'id');}catch(_0xc601e2){throw _0xc601e2;}}exports[_0x5f3d('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x103a68,_0x3a2efb,_0xf53dd0){return Promise[_0x5f3d('0x2b')]()[_0x5f3d('0x18')](function(){if(_0x3a2efb[_0x5f3d('0xb')]>0x0){_0x103a68=_0x103a68[_0x5f3d('0xa')](function(_0x5e3984){return _0x3a2efb['includes'](_0x5e3984['id']);});}return _0x103a68;})[_0x5f3d('0x18')](function(){return db[_0x5f3d('0x2c')][_0x5f3d('0x2d')]({'attributes':['id',_0x5f3d('0x2e'),_0x5f3d('0x2f'),_0x5f3d('0x30'),_0x5f3d('0x5'),_0x5f3d('0x6'),_0x5f3d('0x31'),_0x5f3d('0x7'),'voicePause',_0x5f3d('0x9'),_0x5f3d('0x32')],'where':{'id':{'$in':_[_0x5f3d('0x29')](_0x103a68,'id')}},'raw':!![]});})[_0x5f3d('0x18')](function(_0x56f545){return _0x56f545['map'](function(_0x188c6e){var _0x11c4b1=_[_0x5f3d('0x33')](_0x103a68,['id',_0x188c6e['id']]);var _0x4283db=filterAgentAttributes(_0x11c4b1);_['merge'](_0x188c6e,_0x4283db);_0x188c6e[_0x5f3d('0x34')]=getAgentStatus(_0x188c6e);return _0x188c6e;});})[_0x5f3d('0x18')](function(_0x33f690){var _0x351034=sortAgentsByStatus(_0x33f690,_0xf53dd0);return _[_0x5f3d('0x29')](_0x351034,'id');})[_0x5f3d('0x1e')](function(_0x4853a8){throw _0x4853a8;});}exports[_0x5f3d('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x3c7e5d){var _0x447c9a={'fields':[],'order':null};var _0x84787d=_0x3c7e5d['split'](',');_0x447c9a[_0x5f3d('0x36')]=_[_0x5f3d('0xa')](_0x84787d,function(_0x49d36a){if(!_0x49d36a[_0x5f3d('0x28')]('globalStatus')){return!![];}_0x447c9a[_0x5f3d('0x37')]=_[_0x5f3d('0x38')](_0x49d36a,'-')?_0x5f3d('0x39'):_0x5f3d('0x3a');return![];});return _0x447c9a;}exports[_0x5f3d('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x316d65){if(_0x316d65[_0x5f3d('0x28')](_0x5f3d('0x2f'))&&!_0x316d65[_0x5f3d('0x28')](_0x5f3d('0x3c'))){var _0x34a6ae=_0x316d65[_0x5f3d('0x3d')](0x0,_0x316d65[_0x5f3d('0x3e')]('fullname'));_0x316d65+=','+_0x34a6ae+_0x5f3d('0x3c');}return _0x316d65;}exports[_0x5f3d('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x17240f,_0x271683){var _0x1d187c=_0x17240f[_0x5f3d('0x40')](function(_0x354678,_0x3a60b3){if(_0x354678[_0x5f3d('0x34')]===_0x3a60b3[_0x5f3d('0x34')]){if(_0x354678[_0x5f3d('0x34')]===_0x5f3d('0x10')){if(_0x271683===_0x5f3d('0x39')){return(_0x354678['pauseType']||'')<(_0x3a60b3[_0x5f3d('0x32')]||'')||_0x354678[_0x5f3d('0x2f')][_0x5f3d('0x41')]()>_0x3a60b3[_0x5f3d('0x2f')][_0x5f3d('0x41')]()?0x1:-0x1;}else{return(_0x354678[_0x5f3d('0x32')]||'')<(_0x3a60b3[_0x5f3d('0x32')]||'')||_0x354678['fullname']['toLowerCase']()>_0x3a60b3[_0x5f3d('0x2f')][_0x5f3d('0x41')]()?-0x1:0x1;}}else{if(_0x271683===_0x5f3d('0x39')){return _0x354678[_0x5f3d('0x2f')]['toLowerCase']()<_0x3a60b3[_0x5f3d('0x2f')]['toLowerCase']()?0x1:-0x1;}else{return _0x354678['fullname'][_0x5f3d('0x41')]()<_0x3a60b3[_0x5f3d('0x2f')][_0x5f3d('0x41')]()?-0x1:0x1;}}}else{if(_0x271683==='DESC'){return _0x354678[_0x5f3d('0x34')]<_0x3a60b3[_0x5f3d('0x34')]?0x1:-0x1;}else{return _0x354678[_0x5f3d('0x34')]<_0x3a60b3['globalStatus']?-0x1:0x1;}}});return _0x1d187c;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x5f3060){var _0x802f=[_0x5f3d('0x42'),'online',_0x5f3d('0x43'),'lastPauseAt','pauseType','lastPauseAt',_0x5f3d('0x3c'),_0x5f3d('0x44'),_0x5f3d('0x30'),'openchannelPause',_0x5f3d('0x6'),'smsPause',_0x5f3d('0x9'),_0x5f3d('0x5'),_0x5f3d('0x8'),'chatCapacity',_0x5f3d('0x45'),_0x5f3d('0x46'),_0x5f3d('0x47'),_0x5f3d('0x48'),'faxCapacity',_0x5f3d('0x49'),_0x5f3d('0x4a'),_0x5f3d('0x4b'),'smsCurrentCapacity','whatsappCurrentCapacity',_0x5f3d('0x4c'),_0x5f3d('0x11'),_0x5f3d('0x4d'),_0x5f3d('0x13'),_0x5f3d('0x14'),_0x5f3d('0x15'),'faxStatus',_0x5f3d('0xf'),'chatStatusTime',_0x5f3d('0x4e'),_0x5f3d('0x4f'),_0x5f3d('0x50'),_0x5f3d('0x51'),_0x5f3d('0x52'),_0x5f3d('0x53'),'queue','destconnectedlinenum',_0x5f3d('0x54'),_0x5f3d('0x55'),_0x5f3d('0x56'),_0x5f3d('0x57')];var _0x36a22c=[_0x5f3d('0x30'),_0x5f3d('0x31'),_0x5f3d('0x6'),_0x5f3d('0x7'),'whatsappPause',_0x5f3d('0x5'),'voicePause','online'];var _0xa359bf=_(_0x5f3060)['omit'](_0x36a22c)[_0x5f3d('0x58')](_0x802f)['value']();return _0xa359bf;}exports[_0x5f3d('0x59')]=filterAgentAttributes;
\ No newline at end of file
+var _0xea52=['client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','voiceStatus','pause','every','chatStatus','faxStatus','openchannelStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','startCase','Queue','map','findOne','all','flatten','uniq','getAgentIdsByQueues','getAgentIdsByStatus','resolve','User','findAll','fullname','find','merge','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','includes','internal','substring','validateSortParameter','sort','pauseType','toLowerCase','userpic','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','omit','pick','value','lodash','jayson/promise'];(function(_0x49fa98,_0x11accf){var _0x1698f1=function(_0x22f95f){while(--_0x22f95f){_0x49fa98['push'](_0x49fa98['shift']());}};_0x1698f1(++_0x11accf);}(_0xea52,0xb6));var _0x2ea5=function(_0x25b7bc,_0x4cb6bf){_0x25b7bc=_0x25b7bc-0x0;var _0x479fdb=_0xea52[_0x25b7bc];return _0x479fdb;};'use strict';var _=require(_0x2ea5('0x0'));var jayson=require(_0x2ea5('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x2ea5('0x2')][_0x2ea5('0x3')]({'port':0x232a});var routingClient=jayson[_0x2ea5('0x2')][_0x2ea5('0x3')]({'port':0x232c});function isAgentPaused(_0x2c3792,_0x4bacaf){var _0x10b8cb=[_0x2c3792[_0x2ea5('0x4')],_0x2c3792[_0x2ea5('0x5')],_0x2c3792[_0x2ea5('0x6')],_0x2c3792[_0x2ea5('0x7')],_0x2c3792[_0x2ea5('0x8')],_0x2c3792[_0x2ea5('0x9')],_0x2c3792[_0x2ea5('0xa')]];if(!_0x4bacaf)return _['every'](_0x10b8cb);var _0x4293e0=_[_0x2ea5('0xb')](_0x10b8cb);return _0x4293e0['length']>0x0&&_0x4293e0[_0x2ea5('0xc')]<_0x10b8cb['length']?!![]:![];}function isIdle(_0x554e7f){return _0x554e7f===_0x2ea5('0xd')||_0x554e7f===_0x2ea5('0xe')||_0x554e7f===_0x2ea5('0xf')||_0x554e7f==='ringing'||_['isNil'](_0x554e7f);}function isAgentIdle(_0x373c71){if(_0x373c71[_0x2ea5('0x10')]!==_0x2ea5('0xd')&&_0x373c71[_0x2ea5('0x9')]){_0x373c71[_0x2ea5('0x10')]=_0x2ea5('0x11');return![];}return _[_0x2ea5('0x12')]([_0x373c71[_0x2ea5('0x13')],_0x373c71[_0x2ea5('0x14')],_0x373c71['mailStatus'],_0x373c71[_0x2ea5('0x15')],_0x373c71['smsStatus'],_0x373c71[_0x2ea5('0x10')],_0x373c71[_0x2ea5('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x2ea5('0x17')](_0x2ea5('0x18'),{})['then'](function(_0x98fc){if(_0x98fc[_0x2ea5('0x19')]){throw new Error(_0x2ea5('0x1a'));}var _0x4dd0c0=_0x98fc[_0x2ea5('0x1b')];return routingClient[_0x2ea5('0x17')]('Agents',{})[_0x2ea5('0x1c')](function(_0x187665){if(_0x187665[_0x2ea5('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3a368b=_0x187665[_0x2ea5('0x1b')];return _['merge']({},_0x4dd0c0,_0x3a368b);});})['catch'](function(_0x1cd726){throw _0x1cd726;});}exports[_0x2ea5('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x5b059c){var _0xff829f=_0x2ea5('0xe');if(isAgentPaused(_0x5b059c))_0xff829f=_0x2ea5('0x11');else if(isAgentPaused(_0x5b059c,!![]))_0xff829f=_0x2ea5('0x1e');else if(isAgentIdle(_0x5b059c))_0xff829f=_0x2ea5('0xd');else _0xff829f=_0x2ea5('0x1f');return _0xff829f;}exports[_0x2ea5('0x20')]=getAgentStatus;function getAgentIdsByQueues(_0x5606ba,_0x1b0493){var _0x545cf1=_[_0x2ea5('0x21')](_0x5606ba)?_0x5606ba:[_0x5606ba];var _0x3eb768=_[_0x2ea5('0x22')](_0x1b0493)+_0x2ea5('0x23');var _0xc1a727=_[_0x2ea5('0x24')](_0x545cf1,function(_0x3ec00c){return db[_0x3eb768][_0x2ea5('0x25')]({'where':{'id':_0x3ec00c}})['then'](function(_0x2cf169){if(!_0x2cf169)return[];return _0x2cf169['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x2ea5('0x26')](_0xc1a727)[_0x2ea5('0x1c')](function(_0x4c1f89){var _0x414fdb=_(_0x4c1f89)[_0x2ea5('0x27')]()[_0x2ea5('0x24')]('id')[_0x2ea5('0x28')]()['value']();return _0x414fdb;});}exports[_0x2ea5('0x29')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4efc83,_0x3b23ca,_0x2674ef){try{if(_0x3b23ca[_0x2ea5('0xc')]>0x0){_0x4efc83=_0x4efc83[_0x2ea5('0xb')](function(_0x4b9edb){return _0x3b23ca['includes'](_0x4b9edb['id']);});}var _0x426e9b=_0x4efc83[_0x2ea5('0xb')](function(_0x45fefb){var _0x3f2795=_0x2ea5('0x1f');if(isAgentIdle(_0x45fefb)){_0x3f2795=_0x2ea5('0xd');}return _0x3f2795===_0x2674ef;});return _[_0x2ea5('0x24')](_0x426e9b,'id');}catch(_0x143daf){throw _0x143daf;}}exports[_0x2ea5('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1a42ba,_0x1c547b,_0x3a22ad){return Promise[_0x2ea5('0x2b')]()['then'](function(){if(_0x1c547b[_0x2ea5('0xc')]>0x0){_0x1a42ba=_0x1a42ba['filter'](function(_0x3600b8){return _0x1c547b['includes'](_0x3600b8['id']);});}return _0x1a42ba;})[_0x2ea5('0x1c')](function(){return db[_0x2ea5('0x2c')][_0x2ea5('0x2d')]({'attributes':['id','name',_0x2ea5('0x2e'),_0x2ea5('0x4'),_0x2ea5('0x5'),'mailPause',_0x2ea5('0x7'),'smsPause',_0x2ea5('0x9'),_0x2ea5('0xa'),'pauseType'],'where':{'id':{'$in':_[_0x2ea5('0x24')](_0x1a42ba,'id')}},'raw':!![]});})[_0x2ea5('0x1c')](function(_0xfbadb){return _0xfbadb[_0x2ea5('0x24')](function(_0x20a640){var _0x5475ce=_[_0x2ea5('0x2f')](_0x1a42ba,['id',_0x20a640['id']]);var _0x1c5fd5=filterAgentAttributes(_0x5475ce);_[_0x2ea5('0x30')](_0x20a640,_0x1c5fd5);_0x20a640[_0x2ea5('0x31')]=getAgentStatus(_0x20a640);return _0x20a640;});})[_0x2ea5('0x1c')](function(_0x5cf275){var _0x3bd99a=sortAgentsByStatus(_0x5cf275,_0x3a22ad);return _['map'](_0x3bd99a,'id');})['catch'](function(_0x529486){throw _0x529486;});}exports[_0x2ea5('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5e3540){var _0x6b0093={'fields':[],'order':null};var _0x35556b=_0x5e3540[_0x2ea5('0x33')](',');_0x6b0093[_0x2ea5('0x34')]=_['filter'](_0x35556b,function(_0x18518a){if(!_0x18518a['includes'](_0x2ea5('0x31'))){return!![];}_0x6b0093['order']=_[_0x2ea5('0x35')](_0x18518a,'-')?_0x2ea5('0x36'):_0x2ea5('0x37');return![];});return _0x6b0093;}exports[_0x2ea5('0x38')]=getUpdatedSortOptions;function validateSortParameter(_0xa83646){if(_0xa83646[_0x2ea5('0x39')]('fullname')&&!_0xa83646[_0x2ea5('0x39')](_0x2ea5('0x3a'))){var _0x4d9388=_0xa83646[_0x2ea5('0x3b')](0x0,_0xa83646['indexOf'](_0x2ea5('0x2e')));_0xa83646+=','+_0x4d9388+_0x2ea5('0x3a');}return _0xa83646;}exports[_0x2ea5('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x36b105,_0x34485b){var _0xccabf0=_0x36b105[_0x2ea5('0x3d')](function(_0x146eea,_0x38240c){if(_0x146eea[_0x2ea5('0x31')]===_0x38240c[_0x2ea5('0x31')]){if(_0x146eea['globalStatus']===_0x2ea5('0x11')){if(_0x34485b==='DESC'){return(_0x146eea[_0x2ea5('0x3e')]||'')<(_0x38240c[_0x2ea5('0x3e')]||'')||_0x146eea[_0x2ea5('0x2e')][_0x2ea5('0x3f')]()>_0x38240c[_0x2ea5('0x2e')][_0x2ea5('0x3f')]()?0x1:-0x1;}else{return(_0x146eea['pauseType']||'')<(_0x38240c['pauseType']||'')||_0x146eea[_0x2ea5('0x2e')][_0x2ea5('0x3f')]()>_0x38240c['fullname'][_0x2ea5('0x3f')]()?-0x1:0x1;}}else{if(_0x34485b===_0x2ea5('0x36')){return _0x146eea[_0x2ea5('0x2e')][_0x2ea5('0x3f')]()<_0x38240c[_0x2ea5('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return _0x146eea[_0x2ea5('0x2e')][_0x2ea5('0x3f')]()<_0x38240c['fullname'][_0x2ea5('0x3f')]()?-0x1:0x1;}}}else{if(_0x34485b===_0x2ea5('0x36')){return _0x146eea[_0x2ea5('0x31')]<_0x38240c['globalStatus']?0x1:-0x1;}else{return _0x146eea[_0x2ea5('0x31')]<_0x38240c[_0x2ea5('0x31')]?-0x1:0x1;}}});return _0xccabf0;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x599706){var _0x575869=[_0x2ea5('0x40'),'online','lastLoginAt',_0x2ea5('0x41'),_0x2ea5('0x3e'),_0x2ea5('0x41'),_0x2ea5('0x3a'),_0x2ea5('0x42'),'chatPause',_0x2ea5('0x7'),_0x2ea5('0x6'),_0x2ea5('0x8'),'whatsappPause','faxPause',_0x2ea5('0x9'),'chatCapacity',_0x2ea5('0x43'),_0x2ea5('0x44'),_0x2ea5('0x45'),_0x2ea5('0x46'),'faxCapacity',_0x2ea5('0x47'),_0x2ea5('0x48'),_0x2ea5('0x49'),_0x2ea5('0x4a'),_0x2ea5('0x4b'),'faxCurrentCapacity',_0x2ea5('0x13'),_0x2ea5('0x15'),'mailStatus','smsStatus','whatsappStatus',_0x2ea5('0x14'),'voiceStatus',_0x2ea5('0x4c'),_0x2ea5('0x4d'),_0x2ea5('0x4e'),'smsStatusTime',_0x2ea5('0x4f'),_0x2ea5('0x50'),_0x2ea5('0x51'),_0x2ea5('0x52'),_0x2ea5('0x53'),_0x2ea5('0x54'),_0x2ea5('0x55'),_0x2ea5('0x56'),_0x2ea5('0x57')];var _0xd2859=[_0x2ea5('0x4'),_0x2ea5('0x7'),_0x2ea5('0x6'),'smsPause',_0x2ea5('0xa'),'faxPause','voicePause',_0x2ea5('0x58')];var _0x17fdd1=_(_0x599706)[_0x2ea5('0x59')](_0xd2859)[_0x2ea5('0x5a')](_0x575869)[_0x2ea5('0x5b')]();return _0x17fdd1;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file