// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x13ef=['strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x13ef,0x19c));var _0xf13e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13ef[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf13e('0x0'));var md5=require(_0xf13e('0x1'));var util=require(_0xf13e('0x2'));var Redis=require(_0xf13e('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xf13e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xf13e('0x5'))(new Redis(config[_0xf13e('0x4')]));function MailQueue(_0x44484c){this['id']=_0x44484c['id']||0x0;this['name']=_0x44484c[_0xf13e('0x6')]||'';this[_0xf13e('0x7')]=_0x44484c[_0xf13e('0x7')]||0xa;this['strategy']=_0x44484c[_0xf13e('0x8')]||'beepall';this[_0xf13e('0x9')]=_0x44484c['Agents'];this[_0xf13e('0xa')]={};this[_0xf13e('0xb')]=0x0;this[_0xf13e('0x1')]='';this[_0xf13e('0xc')]();this['updateRealtime']();}MailQueue[_0xf13e('0xd')][_0xf13e('0xc')]=function(){var _0x33a5f9=this[_0xf13e('0xa')][_0xf13e('0xe')];this[_0xf13e('0xa')]=_[_0xf13e('0xf')](this[_0xf13e('0x9')],'id');this[_0xf13e('0xa')][_0xf13e('0xe')]=_0x33a5f9;};MailQueue[_0xf13e('0xd')][_0xf13e('0x10')]=function(){this[_0xf13e('0x11')]=0x0;this[_0xf13e('0x12')]=0x0;for(var _0x406734=0x0;_0x406734<this[_0xf13e('0x9')][_0xf13e('0x13')];_0x406734+=0x1){if(this[_0xf13e('0x9')][_0x406734][_0xf13e('0x14')]){this[_0xf13e('0x11')]+=0x1;}if(this['Agents'][_0x406734]['mailPause']){this['paused']+=0x1;}}this[_0xf13e('0x15')]=this[_0xf13e('0x11')]-this[_0xf13e('0x12')];this[_0xf13e('0x15')]=this['available']>=0x0?this[_0xf13e('0x15')]:0x0;var _0x3f53a4={'id':this['id'],'available':this[_0xf13e('0x15')],'loggedIn':this[_0xf13e('0x11')],'name':this[_0xf13e('0x6')],'paused':this[_0xf13e('0x12')],'waiting':this['waiting']};var _0x462967=md5(JSON[_0xf13e('0x16')](_0x3f53a4));if(this[_0xf13e('0x1')]!==_0x462967){this['md5']=_0x462967;io['to'](util[_0xf13e('0x17')](_0xf13e('0x18'),_0x3f53a4[_0xf13e('0x6')]))[_0xf13e('0x19')](_0xf13e('0x1a'),_0x3f53a4);}};module[_0xf13e('0x1b')]=MailQueue;
\ No newline at end of file
+var _0x7aa2=['name','format','mail_queue:save','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','updateRouting','_rr','map','mapAgentsId','prototype','loggedIn','online','mailPause','paused','available'];(function(_0x37fcda,_0x2f5aa1){var _0xf5ed91=function(_0x3c3241){while(--_0x3c3241){_0x37fcda['push'](_0x37fcda['shift']());}};_0xf5ed91(++_0x2f5aa1);}(_0x7aa2,0xe4));var _0x27aa=function(_0xe2d14f,_0x49fd0e){_0xe2d14f=_0xe2d14f-0x0;var _0x4522d2=_0x7aa2[_0xe2d14f];return _0x4522d2;};'use strict';var _=require(_0x27aa('0x0'));var md5=require('md5');var util=require(_0x27aa('0x1'));var Redis=require('ioredis');var config=require(_0x27aa('0x2'));config[_0x27aa('0x3')]=_[_0x27aa('0x4')](config[_0x27aa('0x3')],{'host':_0x27aa('0x5'),'port':0x18eb});var io=require(_0x27aa('0x6'))(new Redis(config[_0x27aa('0x3')]));function MailQueue(_0x454278){this['id']=_0x454278['id']||0x0;this['name']=_0x454278['name']||'';this[_0x27aa('0x7')]=_0x454278[_0x27aa('0x7')]||0xa;this[_0x27aa('0x8')]=_0x454278[_0x27aa('0x8')]||_0x27aa('0x9');this[_0x27aa('0xa')]=_0x454278[_0x27aa('0xa')];this['mapAgentsId']={};this[_0x27aa('0xb')]=0x0;this[_0x27aa('0xc')]='';this['updateRouting']();this[_0x27aa('0xd')]();}MailQueue['prototype'][_0x27aa('0xe')]=function(){var _0x204fa9=this['mapAgentsId'][_0x27aa('0xf')];this['mapAgentsId']=_[_0x27aa('0x10')](this[_0x27aa('0xa')],'id');this[_0x27aa('0x11')]['_rr']=_0x204fa9;};MailQueue[_0x27aa('0x12')]['updateRealtime']=function(){this[_0x27aa('0x13')]=0x0;this['paused']=0x0;for(var _0x47fe6e=0x0;_0x47fe6e<this[_0x27aa('0xa')]['length'];_0x47fe6e+=0x1){if(this[_0x27aa('0xa')][_0x47fe6e][_0x27aa('0x14')]){this[_0x27aa('0x13')]+=0x1;}if(this['Agents'][_0x47fe6e][_0x27aa('0x15')]){this[_0x27aa('0x16')]+=0x1;}}this[_0x27aa('0x17')]=this['loggedIn']-this[_0x27aa('0x16')];this['available']=this[_0x27aa('0x17')]>=0x0?this['available']:0x0;var _0xf5e83e={'id':this['id'],'available':this['available'],'loggedIn':this[_0x27aa('0x13')],'name':this[_0x27aa('0x18')],'paused':this[_0x27aa('0x16')],'waiting':this[_0x27aa('0xb')]};var _0xbb1d33=md5(JSON['stringify'](_0xf5e83e));if(this[_0x27aa('0xc')]!==_0xbb1d33){this[_0x27aa('0xc')]=_0xbb1d33;io['to'](util[_0x27aa('0x19')]('mail:queue:%s',_0xf5e83e[_0x27aa('0x18')]))['emit'](_0x27aa('0x1a'),_0xf5e83e);}};module[_0x27aa('0x1b')]=MailQueue;
\ No newline at end of file