1 var _0x7437=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6D\x6F\x6D\x65\x6E\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x70\x75\x73\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x66\x6F\x72\x45\x61\x63\x68","\x41\x6C\x6C","\x24\x6F\x72","\x41\x6E\x79","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x69\x64","\x64\x61\x74\x61\x31","\x73\x74\x61\x74\x75\x73","\x61\x63\x74\x69\x6F\x6E","\x41\x63\x74\x69\x6F\x6E\x73","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65","\x66\x69\x65\x6C\x64","\x76\x61\x6C\x75\x65","\x65\x71\x75\x61\x6C\x73","\x6E\x6F\x74\x5F\x65\x71\x75\x61\x6C\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x68\x6F\x75\x72\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x67\x72\x65\x61\x74\x65\x72","\x67\x72\x65\x61\x74\x65\x72\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x6C\x65\x73\x73","\x6C\x65\x73\x73\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x74\x69\x6D\x65\x6F\x75\x74","\x65\x78\x70\x6F\x72\x74\x73","\x63\x68\x61\x6E\x6E\x65\x6C","\x66\x61\x78","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\x65\x72\x72\x6F\x72","\x61\x6C\x6C","\x73\x63\x6F\x70\x65"];_0x7437[0];var _=require(_0x7437[1]);var config=require(_0x7437[2]);var moment=require(_0x7437[3]);var sequelize=require(_0x7437[5])[_0x7437[4]];var Automation=require(_0x7437[5])[_0x7437[6]];var FaxRoom=require(_0x7437[5])[_0x7437[7]];var Settings=require(_0x7437[5])[_0x7437[8]];var automationTimeout;var activeAutomations={};function executeAutomation(_0x6168xb){var _0x6168xc={where:{$and:[],$or:[]}};var _0x6168xd={};_0x6168xb[_0x7437[14]][_0x7437[13]](function(_0x6168xe){_0x6168xc[_0x7437[12]][_0x7437[11]][_0x7437[10]](getCondition(_0x6168xe[_0x7437[9]]))});_0x6168xb[_0x7437[16]][_0x7437[13]](function(_0x6168xe){_0x6168xc[_0x7437[12]][_0x7437[15]][_0x7437[10]](getCondition(_0x6168xe[_0x7437[9]]))});return FaxRoom[_0x7437[25]](_0x6168xc)[_0x7437[24]](function(_0x6168x10){_0x6168x10[_0x7437[13]](function(_0x6168x11){_0x6168xb[_0x7437[23]][_0x7437[13]](function(_0x6168x12){switch(_0x6168x12[_0x7437[22]]){case _0x7437[21]:setStatus(_0x6168x11[_0x7437[19]],_0x6168x12[_0x7437[20]]);break;default:}})})})[_0x7437[18]](function(_0x6168xf){console[_0x7437[17]](_0x6168xf)})}function setStatus(_0x6168x14,_0x6168x15){return FaxRoom[_0x7437[26]]({status:_0x6168x15},{where:{id:_0x6168x14}})[_0x7437[18]](function(_0x6168xf){console[_0x7437[17]](_0x6168xf)})}function getCondition(_0x6168xe){var _0x6168x17={};switch(_0x6168xe[_0x7437[27]]){case _0x7437[21]:switch(_0x6168xe[_0x7437[31]]){case _0x7437[29]:_0x6168x17[_0x6168xe[_0x7437[27]]]=_0x6168xe[_0x7437[28]];break;case _0x7437[30]:_0x6168x17[_0x6168xe[_0x7437[27]]]={$ne:_0x6168xe[_0x7437[28]]};break;default:};break;case _0x7437[40]:var _0x6168x18=moment()[_0x7437[35]](parseInt(_0x6168xe[_0x7437[28]],10),_0x7437[34])[_0x7437[33]](_0x7437[32]);switch(_0x6168xe[_0x7437[31]]){case _0x7437[36]:_0x6168x17[_0x6168xe[_0x7437[27]]]={lt:_0x6168x18};break;case _0x7437[37]:_0x6168x17[_0x6168xe[_0x7437[27]]]={$lte:_0x6168x18};break;case _0x7437[38]:_0x6168x17[_0x6168xe[_0x7437[27]]]={$gt:_0x6168x18};break;case _0x7437[39]:_0x6168x17[_0x6168xe[_0x7437[27]]]={$gte:_0x6168x18};break;default:};break;default:};return _0x6168x17}function createInterval(_0x6168xb){activeAutomations[_0x7437[41]+_0x6168xb[_0x7437[19]]]=setInterval(function(){executeAutomation(_0x6168xb)},_0x6168xb[_0x7437[42]]*60*1000)}module[_0x7437[43]]=function(){Automation[_0x7437[46]](function(_0x6168x1a,_0x6168x1b){if(_0x6168x1a[_0x7437[21]]&&_0x6168x1a[_0x7437[44]]===_0x7437[45]){createInterval(_0x6168x1a)}});Automation[_0x7437[47]](function(_0x6168x1a,_0x6168x1b){if(activeAutomations[_0x7437[41]+_0x6168x1a[_0x7437[19]]]){clearInterval(activeAutomations[_0x7437[41]+_0x6168x1a[_0x7437[19]]])};if(_0x6168x1a[_0x7437[21]]&&_0x6168x1a[_0x7437[44]]===_0x7437[45]){createInterval(_0x6168x1a)}});Automation[_0x7437[48]](function(_0x6168x1a,_0x6168x1b){if(activeAutomations[_0x7437[41]+_0x6168x1a[_0x7437[19]]]){clearInterval(activeAutomations[_0x7437[41]+_0x6168x1a[_0x7437[19]]])}});return Automation[_0x7437[51]](_0x7437[50])[_0x7437[25]]({where:{status:true,channel:_0x7437[45]}})[_0x7437[24]](function(_0x6168x1c){_0x6168x1c[_0x7437[13]](function(_0x6168xb){createInterval(_0x6168xb)})})[_0x7437[18]](function(_0x6168xf){console[_0x7437[49]](_0x6168xf)})}