Built motion from commit 76eb00b9e.|1.0.24
[motion.git] / server / api / mail_room / mail_room.controller.js
index 4a1aa81..02a0896 100644 (file)
@@ -1 +1 @@
-var _0xe882=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\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","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x69\x64","\x6D\x61\x70","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x70\x65\x6E\x64\x69\x6E\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x6E\x65\x77","\x4E\x45\x57","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x69\x6E\x62\x6F\x78","\x53\x45\x4C\x45\x43\x54\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x20\x4C\x45\x46\x54\x20\x4F\x55\x54\x45\x52\x20\x4A\x4F\x49\x4E\x20\x28\x60\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x49\x4E\x4E\x45\x52\x20\x4A\x4F\x49\x4E\x20\x60\x75\x73\x65\x72\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x60\x20\x4F\x4E\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x41\x4E\x44\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x20\x3D\x20\x3A\x73\x74\x61\x74\x75\x73\x20\x4F\x52\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x3A\x69\x64\x29\x29","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x67\x65\x6E\x74","\x53\x45\x4C\x45\x43\x54\x20\x60\x69\x64\x60\x2C\x20\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x20\x2C\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x64\x65\x62\x75\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x2C","\x73\x70\x6C\x69\x74","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x65\x78\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x61\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x61\x63\x63\x6F\x75\x6E\x74\x4E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xe882[0];var _=require(_0xe882[1]);var util=require(_0xe882[2]);var htmlToText=require(_0xe882[3]);var Util=require(_0xe882[4]);var moment=require(_0xe882[5]);var logger=require(_0xe882[7])(_0xe882[6]);var sequelize=require(_0xe882[9])[_0xe882[8]];var User=require(_0xe882[9])[_0xe882[10]];var Agent=require(_0xe882[9])[_0xe882[10]];var Contact=require(_0xe882[9])[_0xe882[11]];var Status=require(_0xe882[9])[_0xe882[12]];var MailRoom=require(_0xe882[9])[_0xe882[13]];var MailMessage=require(_0xe882[9])[_0xe882[14]];var MailAccount=require(_0xe882[9])[_0xe882[15]];var MailApplication=require(_0xe882[9])[_0xe882[16]];var MailQueue=require(_0xe882[9])[_0xe882[17]];var MailAttachment=require(_0xe882[9])[_0xe882[18]];exports[_0xe882[19]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[28]](_0xe882[27])[_0xe882[26]](Util[_0xe882[25]](_0xefc0x12[_0xe882[24]]))[_0xe882[23]](function(_0xefc0x16){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]](_0xefc0x16)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[29]]= function(_0xefc0x12,_0xefc0x13){return MailRoom[_0xe882[29]]()[_0xe882[23]](function(_0xefc0x17){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]](_0xefc0x17)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};function getMailQueues(_0xefc0x19){return function(){switch(_0xefc0x19[_0xe882[35]]){case _0xe882[34]:return User[_0xe882[33]](_0xefc0x19[_0xe882[30]],{attributes:[_0xe882[30]]})[_0xe882[23]](Util[_0xe882[32]]({},{attributes:[_0xe882[30]]}))[_0xe882[23]](function(_0xefc0x1a){return {include:{model:MailAccount,include:{model:MailApplication,include:{model:MailQueue,where:{id:_[_0xe882[31]](_0xefc0x1a,_0xe882[30])}}}}}});default:return {}}}}exports[_0xe882[36]]= function(_0xefc0x12,_0xefc0x13){return Promise[_0xe882[42]]([])[_0xe882[23]](getMailQueues(_0xefc0x12[_0xe882[34]]))[_0xe882[23]](function(_0xefc0x1c){return MailRoom[_0xe882[41]](_[_0xe882[40]](Util[_0xe882[25]](_0xefc0x12[_0xe882[24]],{status:_0xe882[37],updatedAt:{$gte:moment()[_0xe882[39]](_0xe882[38])}}),_0xefc0x1c))})[_0xe882[23]](function(_0xefc0x1b){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]]({value:_0xefc0x1b})})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[43]]= function(_0xefc0x12,_0xefc0x13){return Promise[_0xe882[42]]([])[_0xe882[23]](getMailQueues(_0xefc0x12[_0xe882[34]]))[_0xe882[23]](function(_0xefc0x1c){return MailRoom[_0xe882[41]](_[_0xe882[40]](Util[_0xe882[25]](_0xefc0x12[_0xe882[24]],{status:_0xe882[44],updatedAt:{$gte:moment()[_0xe882[39]](_0xe882[38])}}),_0xefc0x1c))})[_0xe882[23]](function(_0xefc0x1b){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]]({value:_0xefc0x1b})})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[45]]= function(_0xefc0x12,_0xefc0x13){return Promise[_0xe882[42]]([])[_0xe882[23]](getMailQueues(_0xefc0x12[_0xe882[34]]))[_0xe882[23]](function(_0xefc0x1c){return MailRoom[_0xe882[41]](_[_0xe882[40]](Util[_0xe882[25]](_0xefc0x12[_0xe882[24]],{status:_0xe882[46],updatedAt:{$gte:moment()[_0xe882[39]](_0xe882[38])}}),_0xefc0x1c))})[_0xe882[23]](function(_0xefc0x1b){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]]({value:_0xefc0x1b})})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[47]]= function(_0xefc0x12,_0xefc0x13){return Promise[_0xe882[42]]([])[_0xe882[23]](getMailQueues(_0xefc0x12[_0xe882[34]]))[_0xe882[23]](function(_0xefc0x1c){return MailRoom[_0xe882[41]](_[_0xe882[40]](Util[_0xe882[25]](_0xefc0x12[_0xe882[24]],{status:_0xe882[48],updatedAt:{$gte:moment()[_0xe882[39]](_0xe882[38])}}),_0xefc0x1c))})[_0xe882[23]](function(_0xefc0x1b){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]]({value:_0xefc0x1b})})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[49]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){switch(_0xefc0x12[_0xe882[34]][_0xe882[35]]){case _0xe882[54]:return sequelize[_0xe882[24]](_0xe882[50],{replacements:{status:_0xe882[51],id:_0xefc0x12[_0xe882[34]][_0xe882[30]]},type:sequelize[_0xe882[53]][_0xe882[52]]})[_0xe882[23]](function(_0xefc0x16){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]](_0xefc0x16)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)});default:return sequelize[_0xe882[24]](_0xe882[55],{replacements:{status:_0xe882[51],id:_0xefc0x12[_0xe882[34]][_0xe882[30]]},type:sequelize[_0xe882[53]][_0xe882[52]]})[_0xe882[23]](function(_0xefc0x16){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]](_0xefc0x16)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})}};exports[_0xe882[56]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[58]]({where:{UserId:_0xefc0x12[_0xe882[57]][_0xe882[30]]},include:[{all:true}]})[_0xe882[23]](function(_0xefc0x1d){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]](_0xefc0x1d)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[59]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){var _0xefc0x1e;var _0xefc0x1f=[];logger[_0xe882[61]](_0xefc0x12[_0xe882[60]]);logger[_0xe882[61]](_0xefc0x12[_0xe882[57]]);return MailRoom[_0xe882[68]](_0xefc0x12[_0xe882[60]],{where:{id:_0xefc0x12[_0xe882[57]][_0xe882[30]][_0xe882[64]](_0xe882[63])},individualHooks:true})[_0xe882[23]](function(){return Status[_0xe882[67]](_[_0xe882[31]](_0xefc0x12[_0xe882[57]][_0xe882[30]][_0xe882[64]](_0xe882[63]),function(_0xefc0x20){return {status:_0xefc0x12[_0xe882[60]][_0xe882[22]],data1:_0xefc0x12[_0xe882[34]][_0xe882[65]],data2:_0xefc0x12[_0xe882[34]][_0xe882[66]],MailRoomId:_0xefc0x20,UserId:_0xefc0x12[_0xe882[34]][_0xe882[30]]}}))})[_0xe882[23]](function(_0xefc0x1d){return _0xefc0x13[_0xe882[62]](200)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[69]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailMessage[_0xe882[33]](_0xefc0x12[_0xe882[57]][_0xe882[30]])[_0xe882[23]](function(_0xefc0x22){return _0xefc0x22[_0xe882[71]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0xe882[30],_0xe882[65],_0xe882[66],_0xe882[70]]}]},{model:User,attributes:[_0xe882[30],_0xe882[65],_0xe882[66],_0xe882[70]]}]})})[_0xe882[23]](function(_0xefc0x21){return _0xefc0x13[_0xe882[21]](_0xefc0x21)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[72]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[28]](_0xe882[27])[_0xe882[33]](_0xefc0x12[_0xe882[57]][_0xe882[30]])[_0xe882[23]](function(_0xefc0x21){if(!_0xefc0x21){return _0xefc0x13[_0xe882[62]](404)};return _0xefc0x13[_0xe882[21]](_0xefc0x21)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[73]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[33]](_0xefc0x12[_0xe882[57]][_0xe882[30]])[_0xe882[23]](function(_0xefc0x21){if(!_0xefc0x21){return _0xefc0x13[_0xe882[62]](404)};return _0xefc0x21[_0xe882[75]]({attributes:[_0xe882[30],_0xe882[65],_0xe882[66],_0xe882[70],_0xe882[35],_0xe882[74]]})})[_0xe882[23]](function(_0xefc0x23){return _0xefc0x13[_0xe882[21]](_0xefc0x23)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[76]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[76]](_0xefc0x12[_0xe882[60]])[_0xe882[23]](function(_0xefc0x21){return _0xefc0x13[_0xe882[22]](201)[_0xe882[21]](_0xefc0x21)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[77]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){_0xefc0x12[_0xe882[60]][_0xe882[78]]= _0xefc0x12[_0xe882[34]][_0xe882[30]];_0xefc0x12[_0xe882[60]][_0xe882[79]]= _0xefc0x12[_0xe882[57]][_0xe882[30]];_0xefc0x12[_0xe882[60]][_0xe882[80]]= (_0xefc0x12[_0xe882[60]][_0xe882[81]]&& _0xefc0x12[_0xe882[60]][_0xe882[81]][_0xe882[82]])?true:false;_0xefc0x12[_0xe882[60]][_0xe882[83]]= _0xefc0x12[_0xe882[60]][_0xe882[83]]|| htmlToText[_0xe882[85]](_0xefc0x12[_0xe882[60]][_0xe882[84]],{wordwrap:false});return MailRoom[_0xe882[33]](_0xefc0x12[_0xe882[57]][_0xe882[30]])[_0xe882[23]](function(_0xefc0x21){_0xefc0x12[_0xe882[60]][_0xe882[86]]= _0xefc0x21[_0xe882[87]];_0xefc0x12[_0xe882[60]][_0xe882[88]]= _0xefc0x21[_0xe882[89]];return MailMessage[_0xe882[76]](_0xefc0x12[_0xe882[60]],{include:[{model:MailAttachment}],user:_0xefc0x12[_0xe882[34]]})})[_0xe882[23]](function(_0xefc0x22){return _0xefc0x13[_0xe882[22]](201)[_0xe882[21]](_0xefc0x22)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[68]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[33]](_0xefc0x12[_0xe882[57]][_0xe882[30]])[_0xe882[23]](function(_0xefc0x21){if(!_0xefc0x21){return _0xefc0x13[_0xe882[62]](404)};return _0xefc0x21[_0xe882[68]](_0xefc0x12[_0xe882[60]])})[_0xe882[23]](function(_0xefc0x21){return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]](_0xefc0x21)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[90]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){var _0xefc0x24={where:{id:_0xefc0x12[_0xe882[57]][_0xe882[30]][_0xe882[64]](_0xe882[63])},user:_0xefc0x12[_0xe882[34]],individualHooks:true};return MailRoom[_0xe882[68]](_0xefc0x12[_0xe882[60]],_0xefc0x24)[_0xe882[23]](function(_0xefc0x1d){if(!_0xefc0x1d){return _0xefc0x13[_0xe882[62]](404)};return _0xefc0x1d})[_0xe882[23]](function(_0xefc0x1d){return _0xefc0x13[_0xe882[62]](200)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[91]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[33]](_0xefc0x12[_0xe882[57]][_0xe882[30]])[_0xe882[23]](function(_0xefc0x21){if(!_0xefc0x21){return _0xefc0x13[_0xe882[62]](404)};return _0xefc0x21[_0xe882[93]](_0xefc0x12[_0xe882[60]][_0xe882[92]],{individualHooks:true})})[_0xe882[23]](function(){return _0xefc0x13[_0xe882[62]](200)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[94]]= function(_0xefc0x12,_0xefc0x13,_0xefc0x14){return MailRoom[_0xe882[33]](_0xefc0x12[_0xe882[57]][_0xe882[30]])[_0xe882[23]](function(_0xefc0x21){if(!_0xefc0x21){return _0xefc0x13[_0xe882[62]](404)};return _0xefc0x21[_0xe882[94]]()})[_0xe882[23]](function(){return _0xefc0x13[_0xe882[62]](204)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[95]]= function(_0xefc0x12,_0xefc0x13){return MailRoom[_0xe882[94]]({where:{id:_0xefc0x12[_0xe882[24]][_0xe882[96]]},individualHooks:true})[_0xe882[23]](function(){return _0xefc0x13[_0xe882[62]](200)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};exports[_0xe882[97]]= function(_0xefc0x12,_0xefc0x13){return sequelize[_0xe882[24]](_0xe882[100],{type:sequelize[_0xe882[53]][_0xe882[52]]})[_0xe882[23]](function(_0xefc0x25){var _0xefc0x26=_[_0xe882[40]]({new:0,open:0,pending:0,closed:0},_[_0xe882[99]](_[_0xe882[98]](_0xefc0x25,_0xe882[22]),_0xe882[41]));return _0xefc0x13[_0xe882[22]](200)[_0xe882[21]](_0xefc0x26)})[_0xe882[20]](function(_0xefc0x15){return handleError(_0xefc0x13,_0xefc0x15)})};function handleError(_0xefc0x13,_0xefc0x15){logger[_0xe882[102]](_0xefc0x15[_0xe882[101]]);return _0xefc0x13[_0xe882[22]](500)[_0xe882[21]](_0xefc0x15)}
\ No newline at end of file
+var _0xe936=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\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","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x69\x64","\x6D\x61\x70","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x70\x65\x6E\x64\x69\x6E\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x6E\x65\x77","\x4E\x45\x57","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x69\x6E\x62\x6F\x78","\x53\x45\x4C\x45\x43\x54\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x20\x4C\x45\x46\x54\x20\x4F\x55\x54\x45\x52\x20\x4A\x4F\x49\x4E\x20\x28\x60\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x49\x4E\x4E\x45\x52\x20\x4A\x4F\x49\x4E\x20\x60\x75\x73\x65\x72\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x60\x20\x4F\x4E\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x41\x4E\x44\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x20\x3D\x20\x3A\x73\x74\x61\x74\x75\x73\x20\x4F\x52\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x3A\x69\x64\x29\x29","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x67\x65\x6E\x74","\x53\x45\x4C\x45\x43\x54\x20\x60\x69\x64\x60\x2C\x20\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x20\x2C\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x64\x65\x62\x75\x67","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x2C","\x73\x70\x6C\x69\x74","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x65\x78\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x61\x63\x63\x6F\x75\x6E\x74\x49\x64","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x61\x63\x63\x6F\x75\x6E\x74\x4E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x6B\x65\x79\x42\x79","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x20\x57\x48\x45\x52\x45\x20\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xe936[0];var _=require(_0xe936[1]);var util=require(_0xe936[2]);var htmlToText=require(_0xe936[3]);var Util=require(_0xe936[4]);var moment=require(_0xe936[5]);var logger=require(_0xe936[7])(_0xe936[6]);var sequelize=require(_0xe936[9])[_0xe936[8]];var User=require(_0xe936[9])[_0xe936[10]];var Agent=require(_0xe936[9])[_0xe936[10]];var Contact=require(_0xe936[9])[_0xe936[11]];var Status=require(_0xe936[9])[_0xe936[12]];var MailRoom=require(_0xe936[9])[_0xe936[13]];var MailMessage=require(_0xe936[9])[_0xe936[14]];var MailAccount=require(_0xe936[9])[_0xe936[15]];var MailApplication=require(_0xe936[9])[_0xe936[16]];var MailQueue=require(_0xe936[9])[_0xe936[17]];var MailAttachment=require(_0xe936[9])[_0xe936[18]];exports[_0xe936[19]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[28]](_0xe936[27])[_0xe936[26]](Util[_0xe936[25]](_0x63bfx12[_0xe936[24]]))[_0xe936[23]](function(_0x63bfx16){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]](_0x63bfx16)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[29]]= function(_0x63bfx12,_0x63bfx13){return MailRoom[_0xe936[29]]()[_0xe936[23]](function(_0x63bfx17){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]](_0x63bfx17)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};function getMailQueues(_0x63bfx19){return function(){switch(_0x63bfx19[_0xe936[35]]){case _0xe936[34]:return User[_0xe936[33]](_0x63bfx19[_0xe936[30]],{attributes:[_0xe936[30]]})[_0xe936[23]](Util[_0xe936[32]]({},{attributes:[_0xe936[30]]}))[_0xe936[23]](function(_0x63bfx1a){return {include:{model:MailAccount,include:{model:MailApplication,include:{model:MailQueue,where:{id:_[_0xe936[31]](_0x63bfx1a,_0xe936[30])}}}}}});default:return {}}}}exports[_0xe936[36]]= function(_0x63bfx12,_0x63bfx13){return Promise[_0xe936[42]]([])[_0xe936[23]](getMailQueues(_0x63bfx12[_0xe936[34]]))[_0xe936[23]](function(_0x63bfx1c){return MailRoom[_0xe936[41]](_[_0xe936[40]](Util[_0xe936[25]](_0x63bfx12[_0xe936[24]],{status:_0xe936[37],updatedAt:{$gte:moment()[_0xe936[39]](_0xe936[38])}}),_0x63bfx1c))})[_0xe936[23]](function(_0x63bfx1b){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]]({value:_0x63bfx1b})})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[43]]= function(_0x63bfx12,_0x63bfx13){return Promise[_0xe936[42]]([])[_0xe936[23]](getMailQueues(_0x63bfx12[_0xe936[34]]))[_0xe936[23]](function(_0x63bfx1c){return MailRoom[_0xe936[41]](_[_0xe936[40]](Util[_0xe936[25]](_0x63bfx12[_0xe936[24]],{status:_0xe936[44],updatedAt:{$gte:moment()[_0xe936[39]](_0xe936[38])}}),_0x63bfx1c))})[_0xe936[23]](function(_0x63bfx1b){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]]({value:_0x63bfx1b})})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[45]]= function(_0x63bfx12,_0x63bfx13){return Promise[_0xe936[42]]([])[_0xe936[23]](getMailQueues(_0x63bfx12[_0xe936[34]]))[_0xe936[23]](function(_0x63bfx1c){return MailRoom[_0xe936[41]](_[_0xe936[40]](Util[_0xe936[25]](_0x63bfx12[_0xe936[24]],{status:_0xe936[46],updatedAt:{$gte:moment()[_0xe936[39]](_0xe936[38])}}),_0x63bfx1c))})[_0xe936[23]](function(_0x63bfx1b){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]]({value:_0x63bfx1b})})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[47]]= function(_0x63bfx12,_0x63bfx13){return Promise[_0xe936[42]]([])[_0xe936[23]](getMailQueues(_0x63bfx12[_0xe936[34]]))[_0xe936[23]](function(_0x63bfx1c){return MailRoom[_0xe936[41]](_[_0xe936[40]](Util[_0xe936[25]](_0x63bfx12[_0xe936[24]],{status:_0xe936[48],updatedAt:{$gte:moment()[_0xe936[39]](_0xe936[38])}}),_0x63bfx1c))})[_0xe936[23]](function(_0x63bfx1b){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]]({value:_0x63bfx1b})})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[49]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){switch(_0x63bfx12[_0xe936[34]][_0xe936[35]]){case _0xe936[54]:return sequelize[_0xe936[24]](_0xe936[50],{replacements:{status:_0xe936[51],id:_0x63bfx12[_0xe936[34]][_0xe936[30]]},type:sequelize[_0xe936[53]][_0xe936[52]]})[_0xe936[23]](function(_0x63bfx16){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]](_0x63bfx16)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)});default:return sequelize[_0xe936[24]](_0xe936[55],{replacements:{status:_0xe936[51],id:_0x63bfx12[_0xe936[34]][_0xe936[30]]},type:sequelize[_0xe936[53]][_0xe936[52]]})[_0xe936[23]](function(_0x63bfx16){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]](_0x63bfx16)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})}};exports[_0xe936[56]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[58]]({where:{UserId:_0x63bfx12[_0xe936[57]][_0xe936[30]]},include:[{all:true}]})[_0xe936[23]](function(_0x63bfx1d){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]](_0x63bfx1d)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[59]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){var _0x63bfx1e;var _0x63bfx1f=[];logger[_0xe936[61]](_0x63bfx12[_0xe936[60]]);logger[_0xe936[61]](_0x63bfx12[_0xe936[57]]);return MailRoom[_0xe936[68]](_0x63bfx12[_0xe936[60]],{where:{id:_0x63bfx12[_0xe936[57]][_0xe936[30]][_0xe936[64]](_0xe936[63])},individualHooks:true})[_0xe936[23]](function(){return Status[_0xe936[67]](_[_0xe936[31]](_0x63bfx12[_0xe936[57]][_0xe936[30]][_0xe936[64]](_0xe936[63]),function(_0x63bfx20){return {status:_0x63bfx12[_0xe936[60]][_0xe936[22]],data1:_0x63bfx12[_0xe936[34]][_0xe936[65]],data2:_0x63bfx12[_0xe936[34]][_0xe936[66]],MailRoomId:_0x63bfx20,UserId:_0x63bfx12[_0xe936[34]][_0xe936[30]]}}))})[_0xe936[23]](function(_0x63bfx1d){return _0x63bfx13[_0xe936[62]](200)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[69]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailMessage[_0xe936[33]](_0x63bfx12[_0xe936[57]][_0xe936[30]])[_0xe936[23]](function(_0x63bfx22){return _0x63bfx22[_0xe936[71]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0xe936[30],_0xe936[65],_0xe936[66],_0xe936[70]]}]},{model:User,attributes:[_0xe936[30],_0xe936[65],_0xe936[66],_0xe936[70]]}]})})[_0xe936[23]](function(_0x63bfx21){return _0x63bfx13[_0xe936[21]](_0x63bfx21)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[72]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[28]](_0xe936[27])[_0xe936[33]](_0x63bfx12[_0xe936[57]][_0xe936[30]])[_0xe936[23]](function(_0x63bfx21){if(!_0x63bfx21){return _0x63bfx13[_0xe936[62]](404)};return _0x63bfx13[_0xe936[21]](_0x63bfx21)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[73]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[33]](_0x63bfx12[_0xe936[57]][_0xe936[30]])[_0xe936[23]](function(_0x63bfx21){if(!_0x63bfx21){return _0x63bfx13[_0xe936[62]](404)};return _0x63bfx21[_0xe936[75]]({attributes:[_0xe936[30],_0xe936[65],_0xe936[66],_0xe936[70],_0xe936[35],_0xe936[74]]})})[_0xe936[23]](function(_0x63bfx23){return _0x63bfx13[_0xe936[21]](_0x63bfx23)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[76]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[76]](_0x63bfx12[_0xe936[60]])[_0xe936[23]](function(_0x63bfx21){return _0x63bfx13[_0xe936[22]](201)[_0xe936[21]](_0x63bfx21)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[77]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){_0x63bfx12[_0xe936[60]][_0xe936[78]]= _0x63bfx12[_0xe936[34]][_0xe936[30]];_0x63bfx12[_0xe936[60]][_0xe936[79]]= _0x63bfx12[_0xe936[57]][_0xe936[30]];_0x63bfx12[_0xe936[60]][_0xe936[80]]= (_0x63bfx12[_0xe936[60]][_0xe936[81]]&& _0x63bfx12[_0xe936[60]][_0xe936[81]][_0xe936[82]])?true:false;_0x63bfx12[_0xe936[60]][_0xe936[83]]= _0x63bfx12[_0xe936[60]][_0xe936[83]]|| htmlToText[_0xe936[85]](_0x63bfx12[_0xe936[60]][_0xe936[84]],{wordwrap:false});return MailRoom[_0xe936[33]](_0x63bfx12[_0xe936[57]][_0xe936[30]])[_0xe936[23]](function(_0x63bfx21){_0x63bfx12[_0xe936[60]][_0xe936[86]]= _0x63bfx21[_0xe936[87]];_0x63bfx12[_0xe936[60]][_0xe936[88]]= _0x63bfx21[_0xe936[89]];return MailMessage[_0xe936[76]](_0x63bfx12[_0xe936[60]],{include:[{model:MailAttachment}],user:_0x63bfx12[_0xe936[34]]})})[_0xe936[23]](function(_0x63bfx22){return _0x63bfx13[_0xe936[22]](201)[_0xe936[21]](_0x63bfx22)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[68]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[33]](_0x63bfx12[_0xe936[57]][_0xe936[30]])[_0xe936[23]](function(_0x63bfx21){if(!_0x63bfx21){return _0x63bfx13[_0xe936[62]](404)};return _0x63bfx21[_0xe936[68]](_0x63bfx12[_0xe936[60]])})[_0xe936[23]](function(_0x63bfx21){return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]](_0x63bfx21)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[90]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){var _0x63bfx24={where:{id:_0x63bfx12[_0xe936[57]][_0xe936[30]][_0xe936[64]](_0xe936[63])},user:_0x63bfx12[_0xe936[34]],individualHooks:true};return MailRoom[_0xe936[68]](_0x63bfx12[_0xe936[60]],_0x63bfx24)[_0xe936[23]](function(_0x63bfx1d){if(!_0x63bfx1d){return _0x63bfx13[_0xe936[62]](404)};return _0x63bfx1d})[_0xe936[23]](function(_0x63bfx1d){return _0x63bfx13[_0xe936[62]](200)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[91]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[33]](_0x63bfx12[_0xe936[57]][_0xe936[30]])[_0xe936[23]](function(_0x63bfx21){if(!_0x63bfx21){return _0x63bfx13[_0xe936[62]](404)};return _0x63bfx21[_0xe936[93]](_0x63bfx12[_0xe936[60]][_0xe936[92]],{individualHooks:true})})[_0xe936[23]](function(){return _0x63bfx13[_0xe936[62]](200)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[94]]= function(_0x63bfx12,_0x63bfx13,_0x63bfx14){return MailRoom[_0xe936[33]](_0x63bfx12[_0xe936[57]][_0xe936[30]])[_0xe936[23]](function(_0x63bfx21){if(!_0x63bfx21){return _0x63bfx13[_0xe936[62]](404)};return _0x63bfx21[_0xe936[94]]()})[_0xe936[23]](function(){return _0x63bfx13[_0xe936[62]](204)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[95]]= function(_0x63bfx12,_0x63bfx13){return MailRoom[_0xe936[94]]({where:{id:_0x63bfx12[_0xe936[24]][_0xe936[96]]},individualHooks:true})[_0xe936[23]](function(){return _0x63bfx13[_0xe936[62]](200)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};exports[_0xe936[97]]= function(_0x63bfx12,_0x63bfx13){return sequelize[_0xe936[24]](_0xe936[100],{type:sequelize[_0xe936[53]][_0xe936[52]]})[_0xe936[23]](function(_0x63bfx25){var _0x63bfx26=_[_0xe936[40]]({new:0,open:0,pending:0,closed:0},_[_0xe936[99]](_[_0xe936[98]](_0x63bfx25,_0xe936[22]),_0xe936[41]));return _0x63bfx13[_0xe936[22]](200)[_0xe936[21]](_0x63bfx26)})[_0xe936[20]](function(_0x63bfx15){return handleError(_0x63bfx13,_0x63bfx15)})};function handleError(_0x63bfx13,_0x63bfx15){logger[_0xe936[102]](_0x63bfx15[_0xe936[101]]);return _0x63bfx13[_0xe936[22]](500)[_0xe936[21]](_0x63bfx15)}
\ No newline at end of file