Built motion from commit 70c527640.|1.0.24
[motion.git] / server / config / scheduler / reports.js
index 4738c4a..c855f67 100644 (file)
@@ -1 +1 @@
-var _0xc2a3=["\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x6D\x6F\x6D\x65\x6E\x74","\x6D\x6F\x6D\x65\x6E\x74\x2D\x72\x61\x6E\x67\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x70\x61\x74\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x66\x73\x2D\x65\x78\x74\x72\x61","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x52\x65\x70\x6F\x72\x74\x73\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x73\x20\x6C\x61\x75\x6E\x63\x68\x65\x72\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x65\x78\x74\x72\x61\x63\x74\x52\x65\x70\x6F\x72\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x45\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x63\x75\x72\x72\x65\x6E\x74\x44\x61\x79","\x63\x72\x6F\x6E\x54\x79\x70\x65","\x43\x68\x65\x63\x6B\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x20\x72\x61\x6E\x67\x65\x20\x76\x61\x6C\x69\x64\x69\x74\x79\x2E\x2E\x2E","\x76\x61\x6C\x69\x64\x69\x74\x79\x53\x74\x61\x72\x74","\x76\x61\x6C\x69\x64\x69\x74\x79\x45\x6E\x64","\x54\x68\x65\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x20\x69\x73\x20\x76\x61\x6C\x69\x64\x2C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x4F\x75\x74\x20\x6F\x66\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x2C\x20\x73\x6B\x69\x70\x70\x69\x6E\x67\x20\x72\x65\x63\x6F\x72\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x21","\x64\x61\x79\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x79\x65\x73\x74\x65\x72\x64\x61\x79","\x6C\x61\x73\x74\x37","\x6C\x61\x73\x74\x33\x30","\x6D\x6F\x6E\x74\x68","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x6F\x6E\x74\x68\x73","\x65\x6E\x64\x4F\x66","\x6C\x61\x73\x74\x4D\x6F\x6E\x74\x68","\x72\x65\x70\x6F\x72\x74\x52\x61\x6E\x67\x65","\x63\x6F\x6E\x74\x61\x69\x6E\x73","\x68","\x72\x61\x6E\x67\x65","\x74\x65\x78\x74","\x2F\x20","\x70\x61\x72\x65\x6E\x74","\x23","\x66\x69\x6E\x64","\x72\x65\x70\x6F\x72\x74\x54\x79\x70\x65","\x64\x65\x66\x61\x75\x6C\x74","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72\x3A\x20","\x63\x61\x74\x63\x68","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x65\x72\x72\x6F\x72","\x63\x68\x69\x6C\x64\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x63\x68\x69\x6C\x64\x20\x63\x6C\x6F\x73\x65","\x6D\x65\x73\x73\x61\x67\x65","\x63\x68\x69\x6C\x64\x20\x6D\x65\x73\x73\x61\x67\x65","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x73\x74\x61\x74\x75\x73","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x69\x64","\x6B\x69\x6C\x6C","\x61\x64\x6D\x69\x6E","\x72\x65\x70\x6F\x72\x74\x4F\x75\x74\x70\x75\x74","\x73\x65\x6E\x64","\x73\x70\x72\x65\x61\x64","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x6E\x61\x6D\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x6D\x61\x6E\x75\x61\x6C","\x73\x63\x68\x65\x64\x75\x6C\x65\x64","\x63\x72\x65\x61\x74\x65","\x74\x68\x65\x6E","\x52\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x21","\x66\x69\x6E\x64\x42\x79\x49\x64","\x72\x65\x70\x6F\x72\x74\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x66\x69\x6E\x61\x6C\x6C\x79","\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x73\x65\x6E\x74\x21","\x73\x65\x74\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x21","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x52\x65\x70\x6F\x72\x74","\x65\x6D\x61\x69\x6C","\x53\x45\x4E\x44\x49\x4E\x47","\x4E\x6F\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x6F\x72\x20\x53\x4D\x54\x50\x20\x61\x64\x64\x72\x65\x73\x73\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x72\x65\x70\x6F\x72\x74\x73","\x73\x61\x76\x65\x6E\x61\x6D\x65","\x6A\x6F\x69\x6E","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x2E","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x6F\x75\x74\x70\x75\x74","\x62\x61\x73\x65\x6E\x61\x6D\x65","\x63\x6F\x70\x79\x53\x79\x6E\x63","\x73\x75\x63\x63\x65\x73\x73\x21","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x21","\x5F","\x44\x44\x2D\x4D\x4D\x2D\x59\x59\x59\x59","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x65\x6E\x64\x44\x61\x74\x65","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F","\x73\x74\x61\x74\x53\x79\x6E\x63","\x73\x69\x7A\x65","\x65\x78\x70\x6F\x72\x74\x73"];var cp=require(_0xc2a3[0]);var moment=require(_0xc2a3[1]);require(_0xc2a3[2]);var CustomReport=require(_0xc2a3[4])[_0xc2a3[3]];var DefaultReport=require(_0xc2a3[4])[_0xc2a3[5]];var ExtractedReport=require(_0xc2a3[4])[_0xc2a3[6]];var MailAttachment=require(_0xc2a3[4])[_0xc2a3[7]];var MailServerOut=require(_0xc2a3[4])[_0xc2a3[8]];var MailMessage=require(_0xc2a3[4])[_0xc2a3[9]];var path=require(_0xc2a3[10]);var config=require(_0xc2a3[11]);var fs=require(_0xc2a3[12]);var _=require(_0xc2a3[13]);var ReportTree=require(_0xc2a3[4])[_0xc2a3[14]];function Reports(){console[_0xc2a3[16]](_0xc2a3[15])}Reports[_0xc2a3[18]][_0xc2a3[17]]= function(_0xdce0xf,_0xdce0x10){console[_0xc2a3[16]](_0xc2a3[19]);extract(_0xdce0xf,_0xdce0x10)};function extract(_0xdce0xf,_0xdce0x10){switch(_0xdce0xf[_0xc2a3[21]]){case _0xc2a3[20]:extractTodayReport(_0xdce0xf,_0xdce0x10);break;default:extractRangeReport(_0xdce0xf,_0xdce0x10);break}}function extractTodayReport(_0xdce0xf,_0xdce0x10){console[_0xc2a3[16]](_0xc2a3[22]);if(_0xdce0x10|| checkValidity(_0xdce0xf[_0xc2a3[23]],_0xdce0xf[_0xc2a3[24]])){console[_0xc2a3[16]](_0xc2a3[25]);docExtract(_0xdce0xf,moment()[_0xc2a3[27]](_0xc2a3[26]),moment()[_0xc2a3[27]](_0xc2a3[26]),_0xdce0x10)}else {console[_0xc2a3[16]](_0xc2a3[28])}}function extractRangeReport(_0xdce0xf,_0xdce0x10){switch(_0xdce0xf[_0xc2a3[39]]){case _0xc2a3[31]:docExtract(_0xdce0xf,moment()[_0xc2a3[30]](1,_0xc2a3[29])[_0xc2a3[27]](_0xc2a3[26]),moment()[_0xc2a3[30]](1,_0xc2a3[29])[_0xc2a3[27]](_0xc2a3[26]),_0xdce0x10);break;case _0xc2a3[32]:docExtract(_0xdce0xf,moment()[_0xc2a3[30]](7,_0xc2a3[29])[_0xc2a3[27]](_0xc2a3[26]),moment()[_0xc2a3[30]](1,_0xc2a3[29])[_0xc2a3[27]](_0xc2a3[26]),_0xdce0x10);break;case _0xc2a3[33]:docExtract(_0xdce0xf,moment()[_0xc2a3[30]](30,_0xc2a3[29])[_0xc2a3[27]](_0xc2a3[26]),moment()[_0xc2a3[30]](1,_0xc2a3[29])[_0xc2a3[27]](_0xc2a3[26]),_0xdce0x10);break;case _0xc2a3[38]:docExtract(_0xdce0xf,moment()[_0xc2a3[30]](1,_0xc2a3[36])[_0xc2a3[35]](_0xc2a3[34])[_0xc2a3[27]](_0xc2a3[26]),moment()[_0xc2a3[30]](1,_0xc2a3[36])[_0xc2a3[37]](_0xc2a3[34])[_0xc2a3[27]](_0xc2a3[26]),_0xdce0x10);break}}function checkValidity(_0xdce0x15,_0xdce0x16){return moment()[_0xc2a3[42]](moment(_0xdce0x15,_0xc2a3[41]),moment(_0xdce0x16,_0xc2a3[41]))[_0xc2a3[40]](moment())}function getReportPath(_0xdce0x18,_0xdce0x19,path){path= _0xdce0x18[_0xc2a3[43]]+ _0xc2a3[44]+ path;if(_0xdce0x18[_0xc2a3[45]]=== _0xc2a3[46]){return path}else {return getReportPath(_[_0xc2a3[47]](_0xdce0x19,{id:_0xdce0x18[_0xc2a3[45]]}),_0xdce0x19,path)}}function docExtract(_0xdce0xf,_0xdce0x1b,_0xdce0x1c,_0xdce0x10){var _0xdce0x1d=_0xdce0xf[_0xc2a3[48]]=== _0xc2a3[49]?DefaultReport:CustomReport;var _0xdce0x1e;_0xdce0x1d[_0xc2a3[86]](_0xc2a3[85])[_0xc2a3[83]](_0xdce0xf[_0xc2a3[84]])[_0xc2a3[81]](function(_0xdce0x23){if(!_0xdce0x23){console[_0xc2a3[16]](_0xc2a3[82]);return};_0xdce0x1e= _0xdce0x23;return ReportTree[_0xc2a3[83]](_0xdce0xf[_0xc2a3[48]]=== _0xc2a3[49]?1:2)})[_0xc2a3[81]](function(_0xdce0x19){_0xdce0x19= JSON[_0xc2a3[71]](_0xdce0x19[_0xc2a3[70]]);var _0xdce0x18=_[_0xc2a3[47]](_0xdce0x19,{id:_0xdce0x1e[_0xc2a3[45]]});var path=getReportPath(_0xdce0x18,_0xdce0x19,_0xdce0x1e[_0xc2a3[72]]);if(_0xdce0xf[_0xc2a3[21]]=== _0xc2a3[20]){_0xdce0x1e[_0xc2a3[74]][_0xc2a3[73]]= _0xdce0x1e[_0xc2a3[74]][_0xc2a3[73]][_0xc2a3[77]](_0xc2a3[75],_0xc2a3[76])};return [_0xdce0x1e,ExtractedReport[_0xc2a3[80]]({name:_0xdce0x1e[_0xc2a3[72]],startDate:_0xdce0x1b,endDate:_0xdce0x1c,output:_0xdce0xf[_0xc2a3[67]],type:_0xdce0x10?_0xc2a3[78]:_0xc2a3[79],UserId:_0xdce0x10?_0xdce0x10[_0xc2a3[64]]:null})]})[_0xc2a3[69]](function(_0xdce0x1e,_0xdce0x20){var _0xdce0x21=cp[_0xc2a3[53]](__dirname+ _0xc2a3[52]);_0xdce0x21[_0xc2a3[56]](_0xc2a3[59],function(_0xdce0x22){console[_0xc2a3[16]](_0xc2a3[60],_0xdce0x22);if(_0xdce0xf[_0xc2a3[61]]&& _0xdce0x22[_0xc2a3[62]]=== _0xc2a3[63]){sendReportByMail(_0xdce0xf,_0xdce0x20[_0xc2a3[64]],_0xdce0x10,_0xdce0x21)}else {_0xdce0x21[_0xc2a3[65]]()}})[_0xc2a3[56]](_0xc2a3[57],function(){console[_0xc2a3[16]](_0xc2a3[58])})[_0xc2a3[56]](_0xc2a3[54],function(_0xdce0x1f){console[_0xc2a3[16]](_0xc2a3[55],_0xdce0x1f)});_0xdce0x21[_0xc2a3[68]]({report:_0xdce0x1e,query:{startDate:_0xdce0x1b,endDate:_0xdce0x1c},extractedId:_0xdce0x20[_0xc2a3[64]],user:_0xdce0x10?_0xdce0x10:{role:_0xc2a3[66]},type:_0xdce0xf[_0xc2a3[67]]})})[_0xc2a3[51]](function(_0xdce0x1f){console[_0xc2a3[16]](_0xc2a3[50],_0xdce0x1f)})}function sendReportByMail(_0xdce0xf,_0xdce0x25,_0xdce0x10,_0xdce0x21){var _0xdce0x26;return ExtractedReport[_0xc2a3[83]](_0xdce0x25)[_0xc2a3[81]](function(extract){if(!extract){console[_0xc2a3[16]](_0xc2a3[91]);return};_0xdce0x26= extract;var _0xdce0x28;if(_0xdce0xf[_0xc2a3[8]]&& _0xdce0xf[_0xc2a3[8]][_0xc2a3[92]]){var _0xdce0x29=getAttachment(_0xdce0x26);var _0xdce0x2a={subject:_0xc2a3[93],from:[_0xdce0x28],to:[_0xdce0xf[_0xc2a3[94]]],cc:[],html:null,text:null,inReplyTo:null,status:_0xc2a3[95],attachment:true,UserId:_0xdce0x10?_0xdce0x10[_0xc2a3[64]]:null,MailAttachments:[_0xdce0x29]};return MailMessage[_0xc2a3[80]](_0xdce0x2a,{include:[{model:MailAttachment}]})}else {throw  new Error(_0xc2a3[96])}})[_0xc2a3[81]](function(_0xdce0x27){return _0xdce0x26[_0xc2a3[90]](_0xdce0x27)})[_0xc2a3[81]](function(){console[_0xc2a3[16]](_0xc2a3[89])})[_0xc2a3[51]](function(_0xdce0x1f){console[_0xc2a3[16]](_0xc2a3[88],_0xdce0x1f)})[_0xc2a3[87]](function(){_0xdce0x21[_0xc2a3[65]]()})}function getAttachment(extract){var _0xdce0x2c=path[_0xc2a3[102]](config[_0xc2a3[97]],_0xc2a3[98],_0xc2a3[99],_0xc2a3[100],extract[_0xc2a3[101]]);var _0xdce0x2d=path[_0xc2a3[102]](config[_0xc2a3[97]],_0xc2a3[98],_0xc2a3[99],_0xc2a3[103]);var _0xdce0x2e=path[_0xc2a3[107]](extract[_0xc2a3[101]],_0xc2a3[104]+ extract[_0xc2a3[106]][_0xc2a3[105]]());try{fs[_0xc2a3[108]](_0xdce0x2c,path[_0xc2a3[102]](_0xdce0x2d,_0xdce0x2e));console[_0xc2a3[16]](_0xc2a3[109])}catch(err){console[_0xc2a3[54]](_0xc2a3[110]);return null};return {size:getFilesizeInBytes(_0xdce0x2c),path:path[_0xc2a3[102]](_0xdce0x2d,_0xdce0x2e),name:extract[_0xc2a3[72]]+ _0xc2a3[111]+ moment(extract[_0xc2a3[113]])[_0xc2a3[27]](_0xc2a3[112])+ _0xc2a3[111]+ moment(extract[_0xc2a3[114]])[_0xc2a3[27]](_0xc2a3[112])+ _0xc2a3[104]+ extract[_0xc2a3[106]][_0xc2a3[105]](),type:_0xc2a3[115]+ extract[_0xc2a3[106]][_0xc2a3[105]](),basename:_0xdce0x2e}}function getFilesizeInBytes(_0xdce0x30){try{var _0xdce0x31=fs[_0xc2a3[116]](_0xdce0x30);var _0xdce0x32=_0xdce0x31[_0xc2a3[117]];return _0xdce0x32}catch(err){return 0}}module[_0xc2a3[118]]= Reports
\ No newline at end of file
+var _0xd9f5=["\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x6D\x6F\x6D\x65\x6E\x74","\x6D\x6F\x6D\x65\x6E\x74\x2D\x72\x61\x6E\x67\x65","\x2E\x2E\x2F\x75\x74\x69\x6C","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x53\x65\x72\x76\x65\x72\x4F\x75\x74","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x70\x61\x74\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x66\x73\x2D\x65\x78\x74\x72\x61","\x6C\x6F\x64\x61\x73\x68","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x52\x65\x70\x6F\x72\x74\x73\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x73\x20\x6C\x61\x75\x6E\x63\x68\x65\x72\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x69\x6E\x66\x6F","\x65\x78\x74\x72\x61\x63\x74\x52\x65\x70\x6F\x72\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x45\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x63\x75\x72\x72\x65\x6E\x74\x44\x61\x79","\x63\x72\x6F\x6E\x54\x79\x70\x65","\x43\x68\x65\x63\x6B\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x73\x63\x68\x65\x64\x75\x6C\x65\x20\x72\x61\x6E\x67\x65\x20\x76\x61\x6C\x69\x64\x69\x74\x79\x2E\x2E\x2E","\x76\x61\x6C\x69\x64\x69\x74\x79\x53\x74\x61\x72\x74","\x76\x61\x6C\x69\x64\x69\x74\x79\x45\x6E\x64","\x54\x68\x65\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x20\x69\x73\x20\x76\x61\x6C\x69\x64\x2C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6E\x67\x20\x74\x6F\x64\x61\x79\x20\x72\x65\x70\x6F\x72\x74\x2E\x2E\x2E","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x30\x30\x3A\x30\x30","\x32\x33\x3A\x35\x39","\x4F\x75\x74\x20\x6F\x66\x20\x68\x6F\x75\x72\x73\x20\x72\x61\x6E\x67\x65\x2C\x20\x73\x6B\x69\x70\x70\x69\x6E\x67\x20\x72\x65\x63\x6F\x72\x64\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x21","\x64\x61\x79\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x79\x65\x73\x74\x65\x72\x64\x61\x79","\x6C\x61\x73\x74\x37","\x6C\x61\x73\x74\x33\x30","\x6D\x6F\x6E\x74\x68","\x73\x74\x61\x72\x74\x4F\x66","\x6D\x6F\x6E\x74\x68\x73","\x65\x6E\x64\x4F\x66","\x6C\x61\x73\x74\x4D\x6F\x6E\x74\x68","\x72\x65\x70\x6F\x72\x74\x52\x61\x6E\x67\x65","\x63\x6F\x6E\x74\x61\x69\x6E\x73","\x68","\x72\x61\x6E\x67\x65","\x74\x65\x78\x74","\x2F\x20","\x70\x61\x72\x65\x6E\x74","\x23","\x66\x69\x6E\x64","\x72\x65\x70\x6F\x72\x74\x54\x79\x70\x65","\x64\x65\x66\x61\x75\x6C\x74","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x65\x72\x72\x6F\x72\x3A\x20","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x63\x6C\x6F\x73\x65\x64","\x64\x65\x62\x75\x67","\x6D\x65\x73\x73\x61\x67\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x6D\x65\x73\x73\x61\x67\x65","\x73\x65\x6E\x64\x4D\x61\x69\x6C","\x73\x74\x61\x74\x75\x73","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x69\x64","\x6B\x69\x6C\x6C","\x61\x64\x6D\x69\x6E","\x72\x65\x70\x6F\x72\x74\x4F\x75\x74\x70\x75\x74","\x73\x65\x6E\x64","\x73\x70\x72\x65\x61\x64","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x6E\x61\x6D\x65","\x74\x61\x62\x6C\x65","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x68\x69\x73\x74\x6F\x72\x79","","\x72\x65\x70\x6C\x61\x63\x65","\x6D\x61\x6E\x75\x61\x6C","\x73\x63\x68\x65\x64\x75\x6C\x65\x64","\x63\x72\x65\x61\x74\x65","\x74\x68\x65\x6E","\x52\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x21","\x66\x69\x6E\x64\x42\x79\x49\x64","\x72\x65\x70\x6F\x72\x74\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x66\x69\x6E\x61\x6C\x6C\x79","\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x73\x65\x6E\x74\x21","\x73\x65\x74\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x53\x63\x68\x65\x64\x75\x6C\x65\x64\x20\x52\x65\x70\x6F\x72\x74","\x61\x64\x64\x72\x65\x73\x73","\x65\x6D\x61\x69\x6C","\x41\x20\x6E\x65\x77\x20\x72\x65\x70\x6F\x72\x74\x20\x68\x61\x73\x20\x62\x65\x65\x6E\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x20\x63\x68\x65\x63\x6B\x20\x74\x68\x65\x20\x61\x74\x74\x61\x63\x68\x65\x64\x20\x66\x69\x6C\x65\x2E","\x53\x45\x4E\x44\x49\x4E\x47","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2C\x20\x75\x6E\x61\x62\x6C\x65\x20\x74\x6F\x20\x73\x65\x6E\x64\x20\x69\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x4E\x6F\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x6F\x72\x20\x53\x4D\x54\x50\x20\x61\x64\x64\x72\x65\x73\x73\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x20\x74\x6F\x20\x73\x65\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x20\x62\x79\x20\x6D\x61\x69\x6C\x21","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x72\x65\x70\x6F\x72\x74\x73","\x73\x61\x76\x65\x6E\x61\x6D\x65","\x6A\x6F\x69\x6E","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x2E","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x6F\x75\x74\x70\x75\x74","\x62\x61\x73\x65\x6E\x61\x6D\x65","\x63\x6F\x70\x79\x53\x79\x6E\x63","\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x20\x66\x6F\x72\x20\x6D\x61\x69\x6C\x20\x72\x65\x70\x6F\x72\x74\x20\x73\x75\x63\x63\x65\x73\x73\x66\x75\x6C\x6C\x79\x20\x67\x6F\x74\x74\x65\x6E\x21","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x20\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x21","\x67\x65\x74\x46\x69\x6C\x65\x53\x69\x7A\x65","\x5F","\x44\x44\x2D\x4D\x4D\x2D\x59\x59\x59\x59","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x65\x6E\x64\x44\x61\x74\x65","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F","\x65\x78\x70\x6F\x72\x74\x73"];var cp=require(_0xd9f5[0]);var moment=require(_0xd9f5[1]);require(_0xd9f5[2]);var Util=require(_0xd9f5[3]);var logger=require(_0xd9f5[5])(_0xd9f5[4]);var CustomReport=require(_0xd9f5[7])[_0xd9f5[6]];var DefaultReport=require(_0xd9f5[7])[_0xd9f5[8]];var ExtractedReport=require(_0xd9f5[7])[_0xd9f5[9]];var MailAttachment=require(_0xd9f5[7])[_0xd9f5[10]];var MailServerOut=require(_0xd9f5[7])[_0xd9f5[11]];var MailAccount=require(_0xd9f5[7])[_0xd9f5[12]];var MailMessage=require(_0xd9f5[7])[_0xd9f5[13]];var path=require(_0xd9f5[14]);var config=require(_0xd9f5[15]);var fs=require(_0xd9f5[16]);var _=require(_0xd9f5[17]);var ReportTree=require(_0xd9f5[7])[_0xd9f5[18]];function Reports(){logger[_0xd9f5[20]](_0xd9f5[19])}Reports[_0xd9f5[22]][_0xd9f5[21]]= function(_0xd5abx12,_0xd5abx13){logger[_0xd9f5[20]](_0xd9f5[23]);extract(_0xd5abx12,_0xd5abx13)};function extract(_0xd5abx12,_0xd5abx13){switch(_0xd5abx12[_0xd9f5[25]]){case _0xd9f5[24]:extractTodayReport(_0xd5abx12,_0xd5abx13);break;default:extractRangeReport(_0xd5abx12,_0xd5abx13);break}}function extractTodayReport(_0xd5abx12,_0xd5abx13){logger[_0xd9f5[20]](_0xd9f5[26]);if(_0xd5abx13|| checkValidity(_0xd5abx12[_0xd9f5[27]],_0xd5abx12[_0xd9f5[28]])){logger[_0xd9f5[20]](_0xd9f5[29]);docExtract(_0xd5abx12,moment()[_0xd9f5[31]](_0xd9f5[30]),moment()[_0xd9f5[31]](_0xd9f5[30]),_0xd5abx13,_0xd9f5[32],_0xd9f5[33])}else {logger[_0xd9f5[20]](_0xd9f5[34])}}function extractRangeReport(_0xd5abx12,_0xd5abx13){switch(_0xd5abx12[_0xd9f5[45]]){case _0xd9f5[37]:docExtract(_0xd5abx12,moment()[_0xd9f5[36]](1,_0xd9f5[35])[_0xd9f5[31]](_0xd9f5[30]),moment()[_0xd9f5[36]](1,_0xd9f5[35])[_0xd9f5[31]](_0xd9f5[30]),_0xd5abx13);break;case _0xd9f5[38]:docExtract(_0xd5abx12,moment()[_0xd9f5[36]](7,_0xd9f5[35])[_0xd9f5[31]](_0xd9f5[30]),moment()[_0xd9f5[36]](1,_0xd9f5[35])[_0xd9f5[31]](_0xd9f5[30]),_0xd5abx13);break;case _0xd9f5[39]:docExtract(_0xd5abx12,moment()[_0xd9f5[36]](30,_0xd9f5[35])[_0xd9f5[31]](_0xd9f5[30]),moment()[_0xd9f5[36]](1,_0xd9f5[35])[_0xd9f5[31]](_0xd9f5[30]),_0xd5abx13);break;case _0xd9f5[44]:docExtract(_0xd5abx12,moment()[_0xd9f5[36]](1,_0xd9f5[42])[_0xd9f5[41]](_0xd9f5[40])[_0xd9f5[31]](_0xd9f5[30]),moment()[_0xd9f5[36]](1,_0xd9f5[42])[_0xd9f5[43]](_0xd9f5[40])[_0xd9f5[31]](_0xd9f5[30]),_0xd5abx13);break}}function checkValidity(_0xd5abx18,_0xd5abx19){return moment()[_0xd9f5[48]](moment(_0xd5abx18,_0xd9f5[47]),moment(_0xd5abx19,_0xd9f5[47]))[_0xd9f5[46]](moment())}function getReportPath(_0xd5abx1b,_0xd5abx1c,path){path= _0xd5abx1b[_0xd9f5[49]]+ _0xd9f5[50]+ path;if(_0xd5abx1b[_0xd9f5[51]]=== _0xd9f5[52]){return path}else {return getReportPath(_[_0xd9f5[53]](_0xd5abx1c,{id:_0xd5abx1b[_0xd9f5[51]]}),_0xd5abx1c,path)}}function docExtract(_0xd5abx12,_0xd5abx1e,_0xd5abx1f,_0xd5abx13,_0xd5abx20,_0xd5abx21){var _0xd5abx22=_0xd5abx12[_0xd9f5[54]]=== _0xd9f5[55]?DefaultReport:CustomReport;var _0xd5abx23;_0xd5abx22[_0xd9f5[94]](_0xd9f5[93])[_0xd9f5[91]](_0xd5abx12[_0xd9f5[92]])[_0xd9f5[89]](function(_0xd5abx28){if(!_0xd5abx28){logger[_0xd9f5[58]](_0xd9f5[90]);return};_0xd5abx23= _0xd5abx28;return ReportTree[_0xd9f5[91]](_0xd5abx12[_0xd9f5[54]]=== _0xd9f5[55]?1:2)})[_0xd9f5[89]](function(_0xd5abx1c){_0xd5abx1c= JSON[_0xd9f5[79]](_0xd5abx1c[_0xd9f5[78]]);var _0xd5abx1b=_[_0xd9f5[53]](_0xd5abx1c,{id:_0xd5abx23[_0xd9f5[51]]});var path=getReportPath(_0xd5abx1b,_0xd5abx1c,_0xd5abx23[_0xd9f5[80]]);if(_0xd5abx12[_0xd9f5[25]]=== _0xd9f5[24]){_0xd5abx23[_0xd9f5[82]][_0xd9f5[81]]= _0xd5abx23[_0xd9f5[82]][_0xd9f5[81]][_0xd9f5[85]](_0xd9f5[83],_0xd9f5[84])};return [_0xd5abx23,ExtractedReport[_0xd9f5[88]]({name:_0xd5abx23[_0xd9f5[80]],startDate:_0xd5abx1e,endDate:_0xd5abx1f,output:_0xd5abx12[_0xd9f5[75]],type:_0xd5abx13?_0xd9f5[86]:_0xd9f5[87],UserId:_0xd5abx13?_0xd5abx13[_0xd9f5[72]]:null})]})[_0xd9f5[77]](function(_0xd5abx23,_0xd5abx25){var _0xd5abx26=cp[_0xd9f5[61]](__dirname+ _0xd9f5[60]);_0xd5abx26[_0xd9f5[63]](_0xd9f5[67],function(_0xd5abx27){logger[_0xd9f5[66]](_0xd9f5[68],_0xd5abx27);if(_0xd5abx12[_0xd9f5[69]]&& _0xd5abx27[_0xd9f5[70]]=== _0xd9f5[71]){sendReportByMail(_0xd5abx12,_0xd5abx25[_0xd9f5[72]],_0xd5abx13,_0xd5abx26)}else {_0xd5abx26[_0xd9f5[73]]()}})[_0xd9f5[63]](_0xd9f5[64],function(){logger[_0xd9f5[66]](_0xd9f5[65])})[_0xd9f5[63]](_0xd9f5[58],function(_0xd5abx24){logger[_0xd9f5[58]](_0xd9f5[62],_0xd5abx24)});_0xd5abx26[_0xd9f5[76]]({report:_0xd5abx23,query:{startDate:_0xd5abx1e,endDate:_0xd5abx1f,startTime:_0xd5abx20|| null,endTime:_0xd5abx21|| null},extractedId:_0xd5abx25[_0xd9f5[72]],user:_0xd5abx13?_0xd5abx13:{role:_0xd9f5[74]},type:_0xd5abx12[_0xd9f5[75]]})})[_0xd9f5[59]](function(_0xd5abx24){logger[_0xd9f5[58]](_0xd9f5[56],_0xd5abx24[_0xd9f5[57]])})}function sendReportByMail(_0xd5abx12,_0xd5abx2a,_0xd5abx13,_0xd5abx26){var _0xd5abx2b;return ExtractedReport[_0xd9f5[91]](_0xd5abx2a)[_0xd9f5[89]](function(extract){if(!extract){throw  new Error(_0xd9f5[104])};_0xd5abx2b= extract;if(_0xd5abx12[_0xd9f5[11]]&& _0xd5abx12[_0xd9f5[11]][_0xd9f5[72]]){return MailAccount[_0xd9f5[53]]({attributes:[_0xd9f5[72],_0xd9f5[100]],include:[{model:MailServerOut,attributes:[_0xd9f5[72],_0xd9f5[105]],where:{id:_0xd5abx12[_0xd9f5[11]][_0xd9f5[72]]}}]})}else {throw  new Error(_0xd9f5[106])}})[_0xd9f5[89]](function(_0xd5abx2d){var _0xd5abx2e=getAttachment(_0xd5abx2b);var _0xd5abx2f={subject:_0xd9f5[99],from:[_0xd5abx2d[_0xd9f5[100]]],to:[_0xd5abx12[_0xd9f5[101]]],cc:[],html:_0xd9f5[102],text:null,inReplyTo:null,status:_0xd9f5[103],attachment:true,UserId:_0xd5abx13?_0xd5abx13[_0xd9f5[72]]:null,MailAttachments:[_0xd5abx2e]};return MailMessage[_0xd9f5[88]](_0xd5abx2f,{include:[{model:MailAttachment}]})})[_0xd9f5[89]](function(_0xd5abx2c){return _0xd5abx2b[_0xd9f5[98]](_0xd5abx2c)})[_0xd9f5[89]](function(){logger[_0xd9f5[20]](_0xd9f5[97])})[_0xd9f5[59]](function(_0xd5abx24){logger[_0xd9f5[58]](_0xd9f5[96],_0xd5abx24[_0xd9f5[57]])})[_0xd9f5[95]](function(){_0xd5abx26[_0xd9f5[73]]()})}function getAttachment(extract){var _0xd5abx31=path[_0xd9f5[112]](config[_0xd9f5[107]],_0xd9f5[108],_0xd9f5[109],_0xd9f5[110],extract[_0xd9f5[111]]);var _0xd5abx32=path[_0xd9f5[112]](config[_0xd9f5[107]],_0xd9f5[108],_0xd9f5[109],_0xd9f5[113]);var _0xd5abx33=path[_0xd9f5[117]](extract[_0xd9f5[111]],_0xd9f5[114]+ extract[_0xd9f5[116]][_0xd9f5[115]]());try{fs[_0xd9f5[118]](_0xd5abx31,path[_0xd9f5[112]](_0xd5abx32,_0xd5abx33));logger[_0xd9f5[66]](_0xd9f5[119])}catch(err){logger[_0xd9f5[58]](_0xd9f5[120]);return null};return {size:Util[_0xd9f5[121]](_0xd5abx31),path:path[_0xd9f5[112]](_0xd5abx32,_0xd5abx33),name:extract[_0xd9f5[80]]+ _0xd9f5[122]+ moment(extract[_0xd9f5[124]])[_0xd9f5[31]](_0xd9f5[123])+ _0xd9f5[122]+ moment(extract[_0xd9f5[125]])[_0xd9f5[31]](_0xd9f5[123])+ _0xd9f5[114]+ extract[_0xd9f5[116]][_0xd9f5[115]](),type:_0xd9f5[126]+ extract[_0xd9f5[116]][_0xd9f5[115]](),basename:_0xd5abx33}}module[_0xd9f5[127]]= Reports
\ No newline at end of file