a1df6e31ff822882b5e677571da6df531ff884bb
[motion.git] / server / config / tools / dashboard.js
1 var _0x2ef2=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x72\x65\x67\x69\x73\x74\x65\x72","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x69\x64","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x6F\x77\x73","\x74\x68\x65\x6E","\x55\x73\x65\x72","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x75\x73\x65\x72\x49\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74","\x46\x61\x78\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x46\x61\x78\x51\x75\x65\x75\x65","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x53\x6D\x73\x41\x63\x63\x6F\x75\x6E\x74","\x53\x6D\x73\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x53\x6D\x73\x51\x75\x65\x75\x65","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6F\x70\x65\x6E","\x65\x6D\x69\x74","\x4F\x50\x45\x4E","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x61\x6C\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6E\x65\x77","\x4E\x45\x57","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x77\x61\x69\x74\x69\x6E\x67","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x74\x69\x6D\x65\x6F\x75\x74","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x70\x65\x6E\x64\x69\x6E\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6F\x70\x65\x6E","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x63\x6C\x6F\x73\x65\x64","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6E\x65\x77","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x74\x69\x6D\x65\x6F\x75\x74","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6F\x70\x65\x6E","\x46\x61\x78\x52\x6F\x6F\x6D","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x63\x6C\x6F\x73\x65\x64","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6E\x65\x77","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x74\x69\x6D\x65\x6F\x75\x74","\x52\x65\x70\x6F\x72\x74\x46\x61\x78\x53\x65\x73\x73\x69\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x70\x65\x6E\x64\x69\x6E\x67","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x77\x61\x69\x74\x69\x6E\x67","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6F\x70\x65\x6E","\x53\x6D\x73\x52\x6F\x6F\x6D","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x63\x6C\x6F\x73\x65\x64","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6E\x65\x77","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x74\x69\x6D\x65\x6F\x75\x74","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x70\x65\x6E\x64\x69\x6E\x67","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6F\x70\x65\x6E","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x63\x6C\x6F\x73\x65\x64","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x6E\x65\x77","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x74\x69\x6D\x65\x6F\x75\x74","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x64\x61\x73\x68\x62\x6F\x61\x72\x64\x3A\x70\x65\x6E\x64\x69\x6E\x67"];_0x2ef2[0];var sequelize=require(_0x2ef2[2])[_0x2ef2[1]];var models=require(_0x2ef2[2]);var Util=require(_0x2ef2[3]);var _=require(_0x2ef2[4]);var moment=require(_0x2ef2[5]);var Promise=require(_0x2ef2[6]);var logger=require(_0x2ef2[8])(_0x2ef2[7]);exports[_0x2ef2[9]]= function(_0x7eacx8){function _0x7eacx9(_0x7eacxa){onNewChat(_0x7eacx8,_0x7eacxa);onOpenChat(_0x7eacx8,_0x7eacxa);onClosedChat(_0x7eacx8,_0x7eacxa);onTimeoutChat(_0x7eacx8,_0x7eacxa);onAbandonedChat(_0x7eacx8,_0x7eacxa);onUnmanagedChat(_0x7eacx8,_0x7eacxa)}};function getMailQueues(_0x7eacxc,_0x7eacxd){return function(){switch(_0x7eacxc[_0x2ef2[26]]){case _0x2ef2[23]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](Util[_0x2ef2[20]]({},{attributes:[_0x2ef2[13]],include:[{raw:true,model:models[_0x2ef2[19]],attributes:[_0x2ef2[13]]}]}))[_0x2ef2[18]](function(_0x7eacxe){if(_0x7eacxd){return {include:{model:models[_0x2ef2[10]],include:{model:models[_0x2ef2[11]],include:{model:models[_0x2ef2[12]],where:{id:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13])}}}}}}else {var _0x7eacxf=[];_0x7eacxe[_0x2ef2[17]][_0x2ef2[16]](function(_0x7eacx10){_0x7eacxf= _[_0x2ef2[15]](_0x7eacxf,_[_0x2ef2[14]](_0x7eacx10.Users,_0x2ef2[13]))});return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe[_0x2ef2[17]],_0x2ef2[13]),memberid:_0x7eacxf}}}}});case _0x2ef2[25]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](function(_0x7eacx11){return _0x7eacx11[_0x2ef2[24]]({attributes:[_0x2ef2[13]]})})[_0x2ef2[18]](function(_0x7eacxe){return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13]),memberid:_0x7eacxc[_0x2ef2[21]]}}}});default:return {}}}}function getChatQueues(_0x7eacxc,_0x7eacxd){return function(){switch(_0x7eacxc[_0x2ef2[26]]){case _0x2ef2[23]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](Util[_0x2ef2[30]]({},{attributes:[_0x2ef2[13]],include:[{raw:true,model:models[_0x2ef2[19]],attributes:[_0x2ef2[13]]}]}))[_0x2ef2[18]](function(_0x7eacxe){if(_0x7eacxd){return {include:{model:models[_0x2ef2[27]],include:{model:models[_0x2ef2[28]],include:{model:models[_0x2ef2[29]],where:{id:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13])}}}}}}else {var _0x7eacxf=[];_0x7eacxe[_0x2ef2[17]][_0x2ef2[16]](function(_0x7eacx10){_0x7eacxf= _[_0x2ef2[15]](_0x7eacxf,_[_0x2ef2[14]](_0x7eacx10.Users,_0x2ef2[13]))});return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe[_0x2ef2[17]],_0x2ef2[13]),memberid:_0x7eacxf}}}}});case _0x2ef2[25]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](function(_0x7eacx11){return _0x7eacx11[_0x2ef2[31]]({attributes:[_0x2ef2[13]]})})[_0x2ef2[18]](function(_0x7eacxe){return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13]),memberid:_0x7eacxc[_0x2ef2[21]]}}}});default:return {}}}}function getFaxQueues(_0x7eacxc,_0x7eacxd){return function(){switch(_0x7eacxc[_0x2ef2[26]]){case _0x2ef2[23]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](Util[_0x2ef2[35]]({},{attributes:[_0x2ef2[13]],include:[{raw:true,model:models[_0x2ef2[19]],attributes:[_0x2ef2[13]]}]}))[_0x2ef2[18]](function(_0x7eacxe){if(_0x7eacxd){return {include:{model:models[_0x2ef2[32]],include:{model:models[_0x2ef2[33]],include:{model:models[_0x2ef2[34]],where:{id:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13])}}}}}}else {var _0x7eacxf=[];_0x7eacxe[_0x2ef2[17]][_0x2ef2[16]](function(_0x7eacx10){_0x7eacxf= _[_0x2ef2[15]](_0x7eacxf,_[_0x2ef2[14]](_0x7eacx10.Users,_0x2ef2[13]))});return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe[_0x2ef2[17]],_0x2ef2[13]),memberid:_0x7eacxf}}}}});case _0x2ef2[25]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](function(_0x7eacx11){return _0x7eacx11[_0x2ef2[36]]({attributes:[_0x2ef2[13]]})})[_0x2ef2[18]](function(_0x7eacxe){return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13]),memberid:_0x7eacxc[_0x2ef2[21]]}}}});default:return {}}}}function getSmsQueues(_0x7eacxc,_0x7eacxd){return function(){switch(_0x7eacxc[_0x2ef2[26]]){case _0x2ef2[23]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](Util[_0x2ef2[40]]({},{attributes:[_0x2ef2[13]],include:[{raw:true,model:models[_0x2ef2[19]],attributes:[_0x2ef2[13]]}]}))[_0x2ef2[18]](function(_0x7eacxe){if(_0x7eacxd){return {include:{model:models[_0x2ef2[37]],include:{model:models[_0x2ef2[38]],include:{model:models[_0x2ef2[39]],where:{id:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13])}}}}}}else {var _0x7eacxf=[];_0x7eacxe[_0x2ef2[17]][_0x2ef2[16]](function(_0x7eacx10){_0x7eacxf= _[_0x2ef2[15]](_0x7eacxf,_[_0x2ef2[14]](_0x7eacx10.Users,_0x2ef2[13]))});return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe[_0x2ef2[17]],_0x2ef2[13]),memberid:_0x7eacxf}}}}});case _0x2ef2[25]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](function(_0x7eacx11){return _0x7eacx11[_0x2ef2[41]]({attributes:[_0x2ef2[13]]})})[_0x2ef2[18]](function(_0x7eacxe){return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13]),memberid:_0x7eacxc[_0x2ef2[21]]}}}});default:return {}}}}function getOpenchannelQueues(_0x7eacxc,_0x7eacxd){return function(){switch(_0x7eacxc[_0x2ef2[26]]){case _0x2ef2[23]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](Util[_0x2ef2[45]]({},{attributes:[_0x2ef2[13]],include:[{raw:true,model:models[_0x2ef2[19]],attributes:[_0x2ef2[13]]}]}))[_0x2ef2[18]](function(_0x7eacxe){if(_0x7eacxd){return {include:{model:models[_0x2ef2[42]],include:{model:models[_0x2ef2[43]],include:{model:models[_0x2ef2[44]],where:{id:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13])}}}}}}else {var _0x7eacxf=[];_0x7eacxe[_0x2ef2[17]][_0x2ef2[16]](function(_0x7eacx10){_0x7eacxf= _[_0x2ef2[15]](_0x7eacxf,_[_0x2ef2[14]](_0x7eacx10.Users,_0x2ef2[13]))});return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe[_0x2ef2[17]],_0x2ef2[13]),memberid:_0x7eacxf}}}}});case _0x2ef2[25]:return models[_0x2ef2[19]][_0x2ef2[22]](_0x7eacxc[_0x2ef2[21]],{attributes:[_0x2ef2[13]]})[_0x2ef2[18]](function(_0x7eacx11){return _0x7eacx11[_0x2ef2[46]]({attributes:[_0x2ef2[13]]})})[_0x2ef2[18]](function(_0x7eacxe){return {where:{$or:{queue:_[_0x2ef2[14]](_0x7eacxe,_0x2ef2[13]),memberid:_0x7eacxc[_0x2ef2[21]]}}}});default:return {}}}}function onOpenMail(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getMailQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[56]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[51],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[49],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onClosedMail(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getMailQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[56]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[59],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[58],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onNewMail(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getMailQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[56]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[61],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[60],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onWaitingMail(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getMailQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[63]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{leaveAt:null}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[62],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onTimeoutMail(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getMailQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[63]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{timeout:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[64],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onPendingMail(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getMailQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[56]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[66],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[65],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onOpenChat(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getChatQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[68]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{leaveAt:{$ne:null},complete:null,timeout:null}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[67],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onClosedChat(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getChatQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[68]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{complete:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[69],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onNewChat(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getChatQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[68]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{leaveAt:null}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[70],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onTimeoutChat(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getChatQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[68]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{timeout:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[71],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onAbandonedChat(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getChatQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[68]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{abandon:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[72],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onUnmanagedChat(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getChatQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[75]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[74],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[73],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onOpenFax(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getFaxQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[77]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[51],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[76],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onClosedFax(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getFaxQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[77]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[59],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[78],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onNewFax(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getFaxQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[77]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[61],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[79],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onTimeoutFax(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getFaxQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[81]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{timeout:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[80],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onPendingFax(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getFaxQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[77]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[66],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[82],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onWaitingFax(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getFaxQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[81]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{leaveAt:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[83],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onOpenSms(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getSmsQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[85]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[51],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[84],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onClosedSms(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getSmsQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[85]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[59],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[86],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onNewSms(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getSmsQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[85]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[61],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[87],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onTimeoutSms(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getSmsQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[89]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{timeout:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[88],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onPendingSms(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getSmsQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[85]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[66],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[90],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onWaitingSms(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getSmsQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[89]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{leaveAt:null}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[90],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onOpenOpenchannel(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getOpenchannelQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[92]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[51],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[91],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onClosedOpenchannel(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getOpenchannelQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[92]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[59],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[93],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onNewOpenchannel(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getOpenchannelQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[92]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[61],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[94],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onTimeoutOpenchannel(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getOpenchannelQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[96]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{timeout:true}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[95],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onPendingOpenchannel(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getOpenchannelQueues(_0x7eacx8,true))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[92]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{status:_0x2ef2[66],updatedAt:{$gte:moment()[_0x2ef2[53]](_0x2ef2[52])}}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[97],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}function onWaitingOpenchannel(_0x7eacx8,_0x7eacxa){return Promise[_0x2ef2[57]]([])[_0x2ef2[18]](getOpenchannelQueues(_0x7eacx8))[_0x2ef2[18]](function(_0x7eacx19){return models[_0x2ef2[96]][_0x2ef2[55]](_[_0x2ef2[54]]({where:{leaveAt:null}},_0x7eacx19))})[_0x2ef2[18]](function(_0x7eacx18){_0x7eacx8[_0x2ef2[50]](_0x2ef2[97],{value:_0x7eacx18})})[_0x2ef2[48]](function(_0x7eacx17){logger[_0x2ef2[47]](_0x7eacx17)})}