Built motion from commit 3848e0076.|1.0.27
[motion.git] / server / api / custom_report / custom_report.controller.js
index e301afe..bebcd57 100644 (file)
@@ -1 +1 @@
-var _0xfac8=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\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\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\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","\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","\x67\x65\x74\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x72\x79","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x71\x75\x65\x72\x79\x20\x66\x72\x6F\x6D\x20\x61\x70\x69\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x6E\x6F\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6E\x74\x20\x71\x75\x65\x75\x65\x20\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E","\x61\x6C\x6C","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x69\x6C\x79","\x74\x72\x75\x65","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x65\x6E\x64\x44\x61\x74\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","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x70\x72\x65\x76\x69\x65\x77","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x6F\x66\x66\x73\x65\x74","\x73\x6C\x69\x63\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x64\x65\x62\x75\x67","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x53\x56","\x64\x65\x73\x74\x72\x6F\x79\x4E\x6F\x64\x65\x52\x65\x70\x6F\x72\x74\x73","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\x4E\x6F\x64\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x70\x75\x73\x68","\x66\x69\x6C\x74\x65\x72","\x63\x6F\x6D\x6D\x6F\x6E\x20\x64\x6F\x63\x45\x78\x74\x72\x61\x63\x74\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x72\x65\x61\x74\x65\x64\x20\x6E\x65\x77\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x20\x64\x62\x20\x65\x6E\x74\x72\x79\x2C\x20\x63\x61\x6C\x6C\x69\x6E\x67\x20\x65\x78\x74\x65\x72\x6E\x61\x6C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x3A\x20","\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","\x52\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","\x52\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","\x6D\x65\x73\x73\x61\x67\x65","\x52\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","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\x46\x6F\x75\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x2C\x20\x63\x72\x65\x61\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x6E\x65\x77\x20\x44\x42\x20\x72\x6F\x77\x20\x66\x6F\x72\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x2E\x2E","\x73\x74\x61\x72\x74\x54\x69\x6D\x65","\x20","\x30\x30\x3A\x30\x30","\x65\x6E\x64\x54\x69\x6D\x65","\x32\x33\x3A\x35\x39","\x63\x72\x65\x61\x74\x65","\x74\x65\x78\x74","\x2F\x20","\x23","\x73\x68\x6F\x77","\x65\x78\x70\x6F\x72\x74","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x63\x6F\x70\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x62\x6F\x64\x79","\x6D\x61\x70","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x46\x69\x65\x6C\x64\x73","\x69\x6D\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x67\x65\x74\x54\x61\x62\x6C\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x54\x68\x65\x20\x6D\x65\x74\x72\x69\x63\x20\x77\x69\x74\x68\x20\x69\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x63\x75\x73\x74\x6F\x6D","\x54\x68\x65\x20\x66\x69\x65\x6C\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x59\x6F\x75\x20\x68\x61\x76\x65\x20\x6E\x6F\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x6F\x72\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x68\x61\x73","\x65\x76\x65\x72\x79","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x55\x6E\x73\x75\x70\x70\x6F\x72\x74\x65\x64\x20\x49\x6D\x70\x6F\x72\x74\x20\x66\x6F\x72\x6D\x61\x74\x20\x28\x4D\x65\x74\x72\x69\x63\x20\x74\x79\x70\x65\x20\x69\x6E\x20\x72\x65\x70\x6F\x72\x74\x20\x66\x69\x65\x6C\x64\x73\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67\x29","\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x5F","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xfac8[0];var _=require(_0xfac8[1]);var util=require(_0xfac8[2]);var sequelize=require(_0xfac8[4])[_0xfac8[3]];var CustomReport=require(_0xfac8[4])[_0xfac8[5]];var ReportField=require(_0xfac8[4])[_0xfac8[6]];var Metric=require(_0xfac8[4])[_0xfac8[7]];var ExtractedReport=require(_0xfac8[4])[_0xfac8[8]];var extractUtils=require(_0xfac8[9]);var reportBuildUtils=require(_0xfac8[10]);var Util=require(_0xfac8[11]);var sr=require(_0xfac8[12]);var moment=require(_0xfac8[13]);var cp=require(_0xfac8[14]);var ReportTree=require(_0xfac8[4])[_0xfac8[15]];var logger=require(_0xfac8[17])(_0xfac8[16]);exports[_0xfac8[18]]= function(_0x702fx10,_0x702fx11,_0x702fx12){return CustomReport[_0xfac8[25]](Util[_0xfac8[24]](_0x702fx10[_0xfac8[23]],{deletedAt:null}))[_0xfac8[22]](function(_0x702fx14){_0x702fx11[_0xfac8[21]](200)[_0xfac8[20]](_0x702fx14)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[26]]= function(_0x702fx10,_0x702fx11){return Promise[_0xfac8[32]]([])[_0xfac8[22]](getQuery(_0x702fx10,_0x702fx11))[_0xfac8[22]](function(_0x702fx15){if(_0x702fx15){switch(_0x702fx15){case _0xfac8[31]:_0x702fx15= _0xfac8[30];break;default:}};_0x702fx11[_0xfac8[21]](200)[_0xfac8[20]]({query:_0x702fx15})})[_0xfac8[19]](function(_0x702fx13){logger[_0xfac8[29]](_0xfac8[27],_0x702fx13[_0xfac8[28]])})};function getQuery(_0x702fx10,_0x702fx11){var _0x702fx17;return function(){return CustomReport[_0xfac8[53]](_0xfac8[52])[_0xfac8[51]](_0x702fx10[_0xfac8[50]][_0xfac8[49]])[_0xfac8[22]](function(_0x702fx19){if(!_0x702fx19){return _0x702fx11[_0xfac8[37]](404)};if(_0x702fx10[_0xfac8[23]][_0xfac8[38]]&& _0x702fx10[_0xfac8[23]][_0xfac8[38]]=== _0xfac8[39]){_0x702fx10[_0xfac8[23]][_0xfac8[40]]= moment()[_0xfac8[42]](_0xfac8[41]);_0x702fx10[_0xfac8[23]][_0xfac8[43]]= moment()[_0xfac8[42]](_0xfac8[41]);_0x702fx19[_0xfac8[45]][_0xfac8[44]]= _0x702fx19[_0xfac8[45]][_0xfac8[44]][_0xfac8[48]](_0xfac8[46],_0xfac8[47])};delete _0x702fx10[_0xfac8[23]][_0xfac8[38]];_0x702fx17= _0x702fx19[_0xfac8[45]];return _0x702fx17[_0xfac8[44]]})[_0xfac8[22]](reportBuildUtils[_0xfac8[36]](_0x702fx10[_0xfac8[35]]))[_0xfac8[22]](function(_0x702fx18){return [_0x702fx18,_0x702fx17]})[_0xfac8[34]](reportBuildUtils[_0xfac8[33]](_0x702fx10[_0xfac8[23]]))}}exports[_0xfac8[54]]= function(_0x702fx10,_0x702fx11){var _0x702fx1a;return Promise[_0xfac8[32]]([])[_0xfac8[22]](getQuery(_0x702fx10,_0x702fx11))[_0xfac8[22]](reportBuildUtils[_0xfac8[66]]())[_0xfac8[22]](function(_0x702fx1b){if(_0x702fx1b&& _[_0xfac8[55]](_0x702fx1b)){_0x702fx1a= _0x702fx1b[_0xfac8[56]];if(_0x702fx10[_0xfac8[23]][_0xfac8[57]]){_0x702fx1b= _(_0x702fx1b)[_0xfac8[61]](_0x702fx10[_0xfac8[23]][_0xfac8[60]]|| 0)[_0xfac8[59]](_0x702fx10[_0xfac8[23]][_0xfac8[57]])[_0xfac8[58]]()};_[_0xfac8[64]](_0x702fx1b,function(_0x702fx1c){_[_0xfac8[63]](_0x702fx1c,function(_0x702fx1d,_0x702fx1e){if(_0x702fx1d instanceof  Date){_0x702fx1c[_0x702fx1e]= moment(_0x702fx1d)[_0xfac8[42]](_0xfac8[62]).toString()}})});_0x702fx11[_0xfac8[21]](200)[_0xfac8[20]]({rows:_0x702fx1b,count:_0x702fx1a})}else {return handleError(_0x702fx11,{message:_0x702fx1b|| _0xfac8[65]})}})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[67]]= function(_0x702fx10,_0x702fx11){logger[_0xfac8[69]](_0xfac8[68]);docExtract(_0x702fx10,_0x702fx11,_0xfac8[70])};exports[_0xfac8[71]]= function(_0x702fx10,_0x702fx11){logger[_0xfac8[69]](_0xfac8[72]);docExtract(_0x702fx10,_0x702fx11,_0xfac8[73])};exports[_0xfac8[74]]= function(_0x702fx10,_0x702fx11){return ReportTree[_0xfac8[51]](2)[_0xfac8[22]](function(_0x702fx1f){_0x702fx1f= JSON[_0xfac8[76]](_0x702fx1f[_0xfac8[75]]);var _0x702fx20=_[_0xfac8[77]](_0x702fx1f,{id:_0x702fx10[_0xfac8[50]][_0xfac8[49]]});if(!_0x702fx20){throw  new Error(_0xfac8[78])};var _0x702fx21=[];findSubNodes(_0x702fx20,_0x702fx1f,_0x702fx21);return CustomReport[_0xfac8[79]]({where:{parent:_0x702fx21},individualHooks:true})})[_0xfac8[22]](function(){return _0x702fx11[_0xfac8[37]](200)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};function findSubNodes(_0x702fx20,_0x702fx1f,_0x702fx23){_0x702fx23[_0xfac8[80]](_0x702fx20[_0xfac8[49]]);var _0x702fx24=_[_0xfac8[81]](_0x702fx1f,{parent:_0x702fx20[_0xfac8[49]]});if(!_0x702fx24||  !_0x702fx24[_0xfac8[56]]){return};_[_0xfac8[64]](_0x702fx24,function(_0x702fx25){findSubNodes(_0x702fx25,_0x702fx1f,_0x702fx23)})}function docExtract(_0x702fx10,_0x702fx11,_0x702fx27){var _0x702fx19;logger[_0xfac8[69]](_0xfac8[82]);CustomReport[_0xfac8[53]](_0xfac8[52])[_0xfac8[51]](_0x702fx10[_0xfac8[50]][_0xfac8[49]])[_0xfac8[22]](function(_0x702fx17){if(!_0x702fx17){return _0x702fx11[_0xfac8[37]](404)};_0x702fx19= _0x702fx17;return ReportTree[_0xfac8[51]](2)})[_0xfac8[22]](function(_0x702fx1f){_0x702fx1f= JSON[_0xfac8[76]](_0x702fx1f[_0xfac8[75]]);var _0x702fx2b=_[_0xfac8[77]](_0x702fx1f,{id:_0x702fx19[_0xfac8[93]]});var _0x702fx2c=getReportPath(_0x702fx2b,_0x702fx1f,_0x702fx19[_0xfac8[94]]);logger[_0xfac8[69]](_0xfac8[95]);if(_0x702fx10[_0xfac8[23]][_0xfac8[38]]&& _0x702fx10[_0xfac8[23]][_0xfac8[38]]=== _0xfac8[39]){_0x702fx10[_0xfac8[23]][_0xfac8[40]]= moment()[_0xfac8[42]](_0xfac8[41]);_0x702fx10[_0xfac8[23]][_0xfac8[43]]= moment()[_0xfac8[42]](_0xfac8[41]);_0x702fx19[_0xfac8[45]][_0xfac8[44]]= _0x702fx19[_0xfac8[45]][_0xfac8[44]][_0xfac8[48]](_0xfac8[46],_0xfac8[47])};delete _0x702fx10[_0xfac8[23]][_0xfac8[38]];return [_0x702fx19,ExtractedReport[_0xfac8[101]]({name:_0x702fx2c,startDate:_0x702fx10[_0xfac8[23]][_0xfac8[40]]?_0x702fx10[_0xfac8[23]][_0xfac8[40]]+ (_0x702fx10[_0xfac8[23]][_0xfac8[96]]?_0xfac8[97]+ _0x702fx10[_0xfac8[23]][_0xfac8[96]]:_0xfac8[98]):null,endDate:_0x702fx10[_0xfac8[23]][_0xfac8[43]]?_0x702fx10[_0xfac8[23]][_0xfac8[43]]+ (_0x702fx10[_0xfac8[23]][_0xfac8[99]]?_0xfac8[97]+ _0x702fx10[_0xfac8[23]][_0xfac8[99]]:_0xfac8[100]):null,output:_0x702fx27,UserId:_0x702fx10[_0xfac8[35]][_0xfac8[49]]})]})[_0xfac8[34]](function(_0x702fx19,_0x702fx28){logger[_0xfac8[69]](_0xfac8[83]+ _0x702fx27);var _0x702fx29=cp[_0xfac8[85]](__dirname+ _0xfac8[84]);_0x702fx29[_0xfac8[87]](_0xfac8[90],function(_0x702fx2a){logger[_0xfac8[69]](_0xfac8[91],_0x702fx2a);_0x702fx29[_0xfac8[92]]()})[_0xfac8[87]](_0xfac8[88],function(){logger[_0xfac8[69]](_0xfac8[89])})[_0xfac8[87]](_0xfac8[29],function(_0x702fx13){logger[_0xfac8[69]](_0xfac8[86],_0x702fx13)});_0x702fx29[_0xfac8[20]]({report:_0x702fx19,query:_0x702fx10[_0xfac8[23]],extractedId:_0x702fx28[_0xfac8[49]],user:_0x702fx10[_0xfac8[35]],type:_0x702fx27})})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)});return _0x702fx11[_0xfac8[37]](200)}function getReportPath(_0x702fx2b,_0x702fx1f,_0x702fx2c){_0x702fx2c= _0x702fx2b[_0xfac8[102]]+ _0xfac8[103]+ _0x702fx2c;if(_0x702fx2b[_0xfac8[93]]=== _0xfac8[104]){return _0x702fx2c}else {return getReportPath(_[_0xfac8[77]](_0x702fx1f,{id:_0x702fx2b[_0xfac8[93]]}),_0x702fx1f,_0x702fx2c)}}exports[_0xfac8[105]]= function(_0x702fx10,_0x702fx11){return CustomReport[_0xfac8[53]](_0xfac8[52])[_0xfac8[51]](_0x702fx10[_0xfac8[50]][_0xfac8[49]])[_0xfac8[22]](function(_0x702fx19){if(!_0x702fx19){return _0x702fx11[_0xfac8[37]](404)};return _0x702fx11[_0xfac8[20]](_0x702fx19)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[106]]= function(_0x702fx10,_0x702fx11){return CustomReport[_0xfac8[53]]({method:[_0xfac8[109],{CustomReportId:_0x702fx10[_0xfac8[50]][_0xfac8[49]]}]})[_0xfac8[51]](_0x702fx10[_0xfac8[50]][_0xfac8[49]],{attributes:[_0xfac8[107],_0xfac8[108],_0xfac8[94],_0xfac8[93],_0xfac8[44]]})[_0xfac8[22]](function(_0x702fx19){if(!_0x702fx19){return _0x702fx11[_0xfac8[37]](404)};return _0x702fx11[_0xfac8[20]](_0x702fx19)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[110]]= function(_0x702fx10,_0x702fx11){var _0x702fx2e;return sequelize[_0xfac8[115]](function(_0x702fx2f){return CustomReport[_0xfac8[53]](_0xfac8[52])[_0xfac8[51]](_0x702fx10[_0xfac8[50]][_0xfac8[49]])[_0xfac8[22]](function(_0x702fx19){if(!_0x702fx19){return _0x702fx11[_0xfac8[37]](404)};var _0x702fx30=_0x702fx19[_0xfac8[45]];delete _0x702fx30[_0xfac8[49]];delete _0x702fx30[_0xfac8[111]];delete _0x702fx30[_0xfac8[112]];_0x702fx30[_0xfac8[93]]= _0x702fx10[_0xfac8[113]][_0xfac8[93]];_0x702fx2e= _[_0xfac8[114]](_0x702fx30.Fields,_0xfac8[45]);return CustomReport[_0xfac8[101]](_0x702fx30,{transaction:_0x702fx2f})})[_0xfac8[22]](function(_0x702fx19){return [_0x702fx19,_0x702fx2e]})[_0xfac8[34]](createFields(_0x702fx2f))})[_0xfac8[22]](function(){return _0x702fx11[_0xfac8[37]](201)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[101]]= function(_0x702fx10,_0x702fx11){var _0x702fx17;return sequelize[_0xfac8[115]](function(_0x702fx2f){return CustomReport[_0xfac8[101]](_0x702fx10[_0xfac8[113]],{transaction:_0x702fx2f})[_0xfac8[22]](function(_0x702fx19){_0x702fx17= _0x702fx19;return [_0x702fx17,_0x702fx10[_0xfac8[113]][_0xfac8[116]]]})[_0xfac8[34]](createFields(_0x702fx2f))})[_0xfac8[22]](function(){return _0x702fx11[_0xfac8[21]](201)[_0xfac8[20]](_0x702fx17)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[117]]= function(_0x702fx10,_0x702fx11){var _0x702fx17;return sequelize[_0xfac8[115]](function(_0x702fx2f){return CustomReport[_0xfac8[101]](_0x702fx10[_0xfac8[113]],{transaction:_0x702fx2f})[_0xfac8[22]](function(_0x702fx19){_0x702fx17= _0x702fx19;return [_0x702fx17,_0x702fx10[_0xfac8[113]][_0xfac8[116]]]})[_0xfac8[34]](createImportFields(_0x702fx2f))})[_0xfac8[22]](function(){return _0x702fx11[_0xfac8[21]](201)[_0xfac8[20]](_0x702fx17)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[118]]= function(_0x702fx10,_0x702fx11,_0x702fx12){if(_0x702fx10[_0xfac8[113]][_0xfac8[49]]){delete _0x702fx10[_0xfac8[113]][_0xfac8[49]]};var _0x702fx17;return sequelize[_0xfac8[115]](function(_0x702fx2f){return CustomReport[_0xfac8[51]](_0x702fx10[_0xfac8[50]][_0xfac8[49]])[_0xfac8[22]](function(_0x702fx19){if(!_0x702fx19){return _0x702fx11[_0xfac8[37]](404)};var _0x702fx31=_[_0xfac8[119]](_0x702fx19,_0x702fx10[_0xfac8[113]]);return _0x702fx19[_0xfac8[120]]({transaction:_0x702fx2f})})[_0xfac8[22]](function(_0x702fx19){_0x702fx17= _0x702fx19;if(_0x702fx10[_0xfac8[113]][_0xfac8[116]]){return ReportField[_0xfac8[79]]({where:{CustomReportId:_0x702fx10[_0xfac8[50]][_0xfac8[49]]},transaction:_0x702fx2f})}})[_0xfac8[22]](function(){return [_0x702fx17,_0x702fx10[_0xfac8[113]][_0xfac8[116]]]})[_0xfac8[34]](createFields(_0x702fx2f))})[_0xfac8[22]](function(){return _0x702fx11[_0xfac8[37]](200)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};function createFields(_0x702fx2f){return function(_0x702fx19,_0x702fx33){if(_0x702fx33&& Array[_0xfac8[55]](_0x702fx33)&& _0x702fx33[_0xfac8[56]]){var _0x702fx34=reportBuildUtils[_0xfac8[121]](_0x702fx19[_0xfac8[44]]);if(_0x702fx34){var _0x702fx35;return _0x702fx34[_0xfac8[134]]()[_0xfac8[22]](function(_0x702fx3a){_0x702fx35= _[_0xfac8[132]](_0x702fx3a);return Metric[_0xfac8[133]]()})[_0xfac8[22]](function(_0x702fx36){var _0x702fx37=[];_0x702fx36= _[_0xfac8[114]](_0x702fx36,_0xfac8[45]);_0x702fx33[_0xfac8[64]](function(_0x702fx38){_0x702fx38[_0xfac8[122]]= _0x702fx19[_0xfac8[49]];if(_0x702fx38[_0xfac8[123]]){var _0x702fx39=_[_0xfac8[77]](_0x702fx36,{id:_0x702fx38[_0xfac8[123]]});if(_0x702fx39){_0x702fx38[_0xfac8[124]]= _0x702fx39[_0xfac8[125]];_0x702fx37[_0xfac8[80]](ReportField[_0xfac8[101]](_0x702fx38,{transaction:_0x702fx2f}))}else {throw  new sequelize.Error(_0xfac8[126]+ _0x702fx38[_0xfac8[123]]+ _0xfac8[127])}}else {if(_[_0xfac8[128]](_0x702fx35,_0x702fx38[_0xfac8[124]])|| _0x702fx38[_0xfac8[129]]){_0x702fx37[_0xfac8[80]](ReportField[_0xfac8[101]](_0x702fx38,{transaction:_0x702fx2f}))}else {throw  new sequelize.Error(_0xfac8[130]+ _0x702fx38[_0xfac8[124]]+ _0xfac8[131])}}});return _0x702fx37})[_0xfac8[32]]()}else {throw  new sequelize.Error(_0xfac8[135])}}}}function createImportFields(_0x702fx2f){return function(_0x702fx19,_0x702fx33){if(_0x702fx33&& Array[_0xfac8[55]](_0x702fx33)&& _0x702fx33[_0xfac8[56]]){var _0x702fx34=reportBuildUtils[_0xfac8[121]](_0x702fx19[_0xfac8[44]]);if(_0x702fx34){var _0x702fx35;return _0x702fx34[_0xfac8[134]]()[_0xfac8[22]](function(_0x702fx3a){_0x702fx35= _[_0xfac8[132]](_0x702fx3a);var _0x702fx37=[];var _0x702fx3c;if(_[_0xfac8[138]](_0x702fx33,function(_0x702fx38){return _[_0xfac8[137]](_0x702fx38,_0xfac8[136])})){_0x702fx3c= _0xfac8[139]}else {if(_[_0xfac8[138]](_0x702fx33,function(_0x702fx38){return _[_0xfac8[137]](_0x702fx38,_0xfac8[123])})){_0x702fx3c= _0xfac8[7]}else {throw  new sequelize.Error(_0xfac8[140])}};var _0x702fx3d=_[_0xfac8[142]](_0x702fx33,_0x702fx3c+ _0xfac8[141]);_[_0xfac8[63]](_0x702fx3d,function(_0x702fx3e,_0x702fx1e){if(_0x702fx1e!== _0xfac8[143]&& _0x702fx1e!== _0xfac8[144]){_0x702fx3e[0][_0x702fx3c][_0xfac8[145]][_0xfac8[64]](function(_0x702fx38){_0x702fx38[_0xfac8[122]]= _0x702fx19[_0xfac8[49]]});_0x702fx3e[0][_0x702fx3c][_0xfac8[94]]+= _0xfac8[146]+ sr({length:5});_0x702fx37[_0xfac8[80]](Metric[_0xfac8[101]](_0x702fx3e[0][_0x702fx3c],{include:[{model:ReportField,as:_0xfac8[145]}],transaction:_0x702fx2f}))}else {_0x702fx3e[_0xfac8[64]](function(_0x702fx38){if(_[_0xfac8[128]](_0x702fx35,_0x702fx38[_0xfac8[124]])|| _0x702fx38[_0xfac8[129]]){_0x702fx38[_0xfac8[122]]= _0x702fx19[_0xfac8[49]];_0x702fx37[_0xfac8[80]](ReportField[_0xfac8[101]](_0x702fx38,{transaction:_0x702fx2f}))}else {throw  new sequelize.Error(_0xfac8[130]+ _0x702fx38[_0xfac8[124]]+ _0xfac8[131])}})}});return _0x702fx37})[_0xfac8[32]]()}else {throw  new sequelize.Error(_0xfac8[135])}}}}exports[_0xfac8[79]]= function(_0x702fx10,_0x702fx11){return CustomReport[_0xfac8[51]](_0x702fx10[_0xfac8[50]][_0xfac8[49]])[_0xfac8[22]](function(_0x702fx19){if(!_0x702fx19){return _0x702fx11[_0xfac8[37]](404)};return _0x702fx19[_0xfac8[79]]()})[_0xfac8[22]](function(){return _0x702fx11[_0xfac8[37]](204)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};exports[_0xfac8[147]]= function(_0x702fx10,_0x702fx11){return CustomReport[_0xfac8[79]]({where:{id:_0x702fx10[_0xfac8[23]][_0xfac8[148]]},individualHooks:true})[_0xfac8[22]](function(){return _0x702fx11[_0xfac8[37]](204)})[_0xfac8[19]](function(_0x702fx13){return handleError(_0x702fx11,_0x702fx13)})};function handleError(_0x702fx11,_0x702fx13){logger[_0xfac8[29]](_0x702fx13[_0xfac8[28]]);return _0x702fx11[_0xfac8[21]](500)[_0xfac8[20]](_0x702fx13)}
\ No newline at end of file
+var _0x83aa=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x45\x78\x74\x72\x61\x63\x74\x65\x64\x52\x65\x70\x6F\x72\x74","\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\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x62\x75\x69\x6C\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\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","\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","\x67\x65\x74\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x72\x79","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x71\x75\x65\x72\x79\x20\x66\x72\x6F\x6D\x20\x61\x70\x69\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x6E\x6F\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6E\x74\x20\x71\x75\x65\x75\x65\x20\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E","\x61\x6C\x6C","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x64\x61\x69\x6C\x79","\x74\x72\x75\x65","\x73\x74\x61\x72\x74\x44\x61\x74\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44","\x66\x6F\x72\x6D\x61\x74","\x65\x6E\x64\x44\x61\x74\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","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x70\x72\x65\x76\x69\x65\x77","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x6F\x66\x66\x73\x65\x74","\x73\x6C\x69\x63\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x64\x65\x62\x75\x67","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x53\x56","\x64\x65\x73\x74\x72\x6F\x79\x4E\x6F\x64\x65\x52\x65\x70\x6F\x72\x74\x73","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\x4E\x6F\x64\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x64\x65\x73\x74\x72\x6F\x79","\x70\x75\x73\x68","\x66\x69\x6C\x74\x65\x72","\x63\x6F\x6D\x6D\x6F\x6E\x20\x64\x6F\x63\x45\x78\x74\x72\x61\x63\x74\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x72\x65\x61\x74\x65\x64\x20\x6E\x65\x77\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x20\x64\x62\x20\x65\x6E\x74\x72\x79\x2C\x20\x63\x61\x6C\x6C\x69\x6E\x67\x20\x65\x78\x74\x65\x72\x6E\x61\x6C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x3A\x20","\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","\x52\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","\x52\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","\x6D\x65\x73\x73\x61\x67\x65","\x52\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","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\x46\x6F\x75\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x2C\x20\x63\x72\x65\x61\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x6E\x65\x77\x20\x44\x42\x20\x72\x6F\x77\x20\x66\x6F\x72\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x2E\x2E","\x73\x74\x61\x72\x74\x54\x69\x6D\x65","\x20","\x30\x30\x3A\x30\x30","\x65\x6E\x64\x54\x69\x6D\x65","\x32\x33\x3A\x35\x39","\x63\x72\x65\x61\x74\x65","\x74\x65\x78\x74","\x2F\x20","\x23","\x73\x68\x6F\x77","\x65\x78\x70\x6F\x72\x74","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x63\x6F\x70\x79","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\x62\x6F\x64\x79","\x6D\x61\x70","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x46\x69\x65\x6C\x64\x73","\x69\x6D\x70\x6F\x72\x74","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x67\x65\x74\x54\x61\x62\x6C\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x54\x68\x65\x20\x6D\x65\x74\x72\x69\x63\x20\x77\x69\x74\x68\x20\x69\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x63\x75\x73\x74\x6F\x6D","\x54\x68\x65\x20\x66\x69\x65\x6C\x64\x20","\x20\x79\x6F\x75\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74\x20\x69\x6E\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x59\x6F\x75\x20\x68\x61\x76\x65\x20\x6E\x6F\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x6F\x72\x20\x74\x68\x65\x20\x74\x61\x62\x6C\x65\x20\x64\x6F\x65\x73\x20\x6E\x6F\x74\x20\x65\x78\x69\x73\x74","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x68\x61\x73","\x65\x76\x65\x72\x79","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x55\x6E\x73\x75\x70\x70\x6F\x72\x74\x65\x64\x20\x49\x6D\x70\x6F\x72\x74\x20\x66\x6F\x72\x6D\x61\x74\x20\x28\x4D\x65\x74\x72\x69\x63\x20\x74\x79\x70\x65\x20\x69\x6E\x20\x72\x65\x70\x6F\x72\x74\x20\x66\x69\x65\x6C\x64\x73\x20\x69\x73\x20\x6D\x69\x73\x73\x69\x6E\x67\x29","\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x5F","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x83aa[0];var _=require(_0x83aa[1]);var util=require(_0x83aa[2]);var sequelize=require(_0x83aa[4])[_0x83aa[3]];var CustomReport=require(_0x83aa[4])[_0x83aa[5]];var ReportField=require(_0x83aa[4])[_0x83aa[6]];var Metric=require(_0x83aa[4])[_0x83aa[7]];var ExtractedReport=require(_0x83aa[4])[_0x83aa[8]];var extractUtils=require(_0x83aa[9]);var reportBuildUtils=require(_0x83aa[10]);var Util=require(_0x83aa[11]);var sr=require(_0x83aa[12]);var moment=require(_0x83aa[13]);var cp=require(_0x83aa[14]);var ReportTree=require(_0x83aa[4])[_0x83aa[15]];var logger=require(_0x83aa[17])(_0x83aa[16]);exports[_0x83aa[18]]= function(_0x1402x10,_0x1402x11,_0x1402x12){return CustomReport[_0x83aa[25]](Util[_0x83aa[24]](_0x1402x10[_0x83aa[23]],{deletedAt:null}))[_0x83aa[22]](function(_0x1402x14){_0x1402x11[_0x83aa[21]](200)[_0x83aa[20]](_0x1402x14)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[26]]= function(_0x1402x10,_0x1402x11){return Promise[_0x83aa[32]]([])[_0x83aa[22]](getQuery(_0x1402x10,_0x1402x11))[_0x83aa[22]](function(_0x1402x15){if(_0x1402x15){switch(_0x1402x15){case _0x83aa[31]:_0x1402x15= _0x83aa[30];break;default:}};_0x1402x11[_0x83aa[21]](200)[_0x83aa[20]]({query:_0x1402x15})})[_0x83aa[19]](function(_0x1402x13){logger[_0x83aa[29]](_0x83aa[27],_0x1402x13[_0x83aa[28]])})};function getQuery(_0x1402x10,_0x1402x11){var _0x1402x17;return function(){return CustomReport[_0x83aa[53]](_0x83aa[52])[_0x83aa[51]](_0x1402x10[_0x83aa[50]][_0x83aa[49]])[_0x83aa[22]](function(_0x1402x19){if(!_0x1402x19){return _0x1402x11[_0x83aa[37]](404)};if(_0x1402x10[_0x83aa[23]][_0x83aa[38]]&& _0x1402x10[_0x83aa[23]][_0x83aa[38]]=== _0x83aa[39]){_0x1402x10[_0x83aa[23]][_0x83aa[40]]= moment()[_0x83aa[42]](_0x83aa[41]);_0x1402x10[_0x83aa[23]][_0x83aa[43]]= moment()[_0x83aa[42]](_0x83aa[41]);_0x1402x19[_0x83aa[45]][_0x83aa[44]]= _0x1402x19[_0x83aa[45]][_0x83aa[44]][_0x83aa[48]](_0x83aa[46],_0x83aa[47])};delete _0x1402x10[_0x83aa[23]][_0x83aa[38]];_0x1402x17= _0x1402x19[_0x83aa[45]];return _0x1402x17[_0x83aa[44]]})[_0x83aa[22]](reportBuildUtils[_0x83aa[36]](_0x1402x10[_0x83aa[35]]))[_0x83aa[22]](function(_0x1402x18){return [_0x1402x18,_0x1402x17]})[_0x83aa[34]](reportBuildUtils[_0x83aa[33]](_0x1402x10[_0x83aa[23]]))}}exports[_0x83aa[54]]= function(_0x1402x10,_0x1402x11){var _0x1402x1a;return Promise[_0x83aa[32]]([])[_0x83aa[22]](getQuery(_0x1402x10,_0x1402x11))[_0x83aa[22]](reportBuildUtils[_0x83aa[66]]())[_0x83aa[22]](function(_0x1402x1b){if(_0x1402x1b&& _[_0x83aa[55]](_0x1402x1b)){_0x1402x1a= _0x1402x1b[_0x83aa[56]];if(_0x1402x10[_0x83aa[23]][_0x83aa[57]]){_0x1402x1b= _(_0x1402x1b)[_0x83aa[61]](_0x1402x10[_0x83aa[23]][_0x83aa[60]]|| 0)[_0x83aa[59]](_0x1402x10[_0x83aa[23]][_0x83aa[57]])[_0x83aa[58]]()};_[_0x83aa[64]](_0x1402x1b,function(_0x1402x1c){_[_0x83aa[63]](_0x1402x1c,function(_0x1402x1d,_0x1402x1e){if(_0x1402x1d instanceof  Date){_0x1402x1c[_0x1402x1e]= moment(_0x1402x1d)[_0x83aa[42]](_0x83aa[62]).toString()}})});_0x1402x11[_0x83aa[21]](200)[_0x83aa[20]]({rows:_0x1402x1b,count:_0x1402x1a})}else {return handleError(_0x1402x11,{message:_0x1402x1b|| _0x83aa[65]})}})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[67]]= function(_0x1402x10,_0x1402x11){logger[_0x83aa[69]](_0x83aa[68]);docExtract(_0x1402x10,_0x1402x11,_0x83aa[70])};exports[_0x83aa[71]]= function(_0x1402x10,_0x1402x11){logger[_0x83aa[69]](_0x83aa[72]);docExtract(_0x1402x10,_0x1402x11,_0x83aa[73])};exports[_0x83aa[74]]= function(_0x1402x10,_0x1402x11){return ReportTree[_0x83aa[51]](2)[_0x83aa[22]](function(_0x1402x1f){_0x1402x1f= JSON[_0x83aa[76]](_0x1402x1f[_0x83aa[75]]);var _0x1402x20=_[_0x83aa[77]](_0x1402x1f,{id:_0x1402x10[_0x83aa[50]][_0x83aa[49]]});if(!_0x1402x20){throw  new Error(_0x83aa[78])};var _0x1402x21=[];findSubNodes(_0x1402x20,_0x1402x1f,_0x1402x21);return CustomReport[_0x83aa[79]]({where:{parent:_0x1402x21},individualHooks:true})})[_0x83aa[22]](function(){return _0x1402x11[_0x83aa[37]](200)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};function findSubNodes(_0x1402x20,_0x1402x1f,_0x1402x23){_0x1402x23[_0x83aa[80]](_0x1402x20[_0x83aa[49]]);var _0x1402x24=_[_0x83aa[81]](_0x1402x1f,{parent:_0x1402x20[_0x83aa[49]]});if(!_0x1402x24||  !_0x1402x24[_0x83aa[56]]){return};_[_0x83aa[64]](_0x1402x24,function(_0x1402x25){findSubNodes(_0x1402x25,_0x1402x1f,_0x1402x23)})}function docExtract(_0x1402x10,_0x1402x11,_0x1402x27){var _0x1402x19;logger[_0x83aa[69]](_0x83aa[82]);CustomReport[_0x83aa[53]](_0x83aa[52])[_0x83aa[51]](_0x1402x10[_0x83aa[50]][_0x83aa[49]])[_0x83aa[22]](function(_0x1402x17){if(!_0x1402x17){return _0x1402x11[_0x83aa[37]](404)};_0x1402x19= _0x1402x17;return ReportTree[_0x83aa[51]](2)})[_0x83aa[22]](function(_0x1402x1f){_0x1402x1f= JSON[_0x83aa[76]](_0x1402x1f[_0x83aa[75]]);var _0x1402x2b=_[_0x83aa[77]](_0x1402x1f,{id:_0x1402x19[_0x83aa[93]]});var _0x1402x2c=getReportPath(_0x1402x2b,_0x1402x1f,_0x1402x19[_0x83aa[94]]);logger[_0x83aa[69]](_0x83aa[95]);if(_0x1402x10[_0x83aa[23]][_0x83aa[38]]&& _0x1402x10[_0x83aa[23]][_0x83aa[38]]=== _0x83aa[39]){_0x1402x10[_0x83aa[23]][_0x83aa[40]]= moment()[_0x83aa[42]](_0x83aa[41]);_0x1402x10[_0x83aa[23]][_0x83aa[43]]= moment()[_0x83aa[42]](_0x83aa[41]);_0x1402x19[_0x83aa[45]][_0x83aa[44]]= _0x1402x19[_0x83aa[45]][_0x83aa[44]][_0x83aa[48]](_0x83aa[46],_0x83aa[47])};delete _0x1402x10[_0x83aa[23]][_0x83aa[38]];return [_0x1402x19,ExtractedReport[_0x83aa[101]]({name:_0x1402x2c,startDate:_0x1402x10[_0x83aa[23]][_0x83aa[40]]?_0x1402x10[_0x83aa[23]][_0x83aa[40]]+ (_0x1402x10[_0x83aa[23]][_0x83aa[96]]?_0x83aa[97]+ _0x1402x10[_0x83aa[23]][_0x83aa[96]]:_0x83aa[98]):null,endDate:_0x1402x10[_0x83aa[23]][_0x83aa[43]]?_0x1402x10[_0x83aa[23]][_0x83aa[43]]+ (_0x1402x10[_0x83aa[23]][_0x83aa[99]]?_0x83aa[97]+ _0x1402x10[_0x83aa[23]][_0x83aa[99]]:_0x83aa[100]):null,output:_0x1402x27,UserId:_0x1402x10[_0x83aa[35]][_0x83aa[49]]})]})[_0x83aa[34]](function(_0x1402x19,_0x1402x28){logger[_0x83aa[69]](_0x83aa[83]+ _0x1402x27);var _0x1402x29=cp[_0x83aa[85]](__dirname+ _0x83aa[84]);_0x1402x29[_0x83aa[87]](_0x83aa[90],function(_0x1402x2a){logger[_0x83aa[69]](_0x83aa[91],_0x1402x2a);_0x1402x29[_0x83aa[92]]()})[_0x83aa[87]](_0x83aa[88],function(){logger[_0x83aa[69]](_0x83aa[89])})[_0x83aa[87]](_0x83aa[29],function(_0x1402x13){logger[_0x83aa[69]](_0x83aa[86],_0x1402x13)});_0x1402x29[_0x83aa[20]]({report:_0x1402x19,query:_0x1402x10[_0x83aa[23]],extractedId:_0x1402x28[_0x83aa[49]],user:_0x1402x10[_0x83aa[35]],type:_0x1402x27})})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)});return _0x1402x11[_0x83aa[37]](200)}function getReportPath(_0x1402x2b,_0x1402x1f,_0x1402x2c){_0x1402x2c= _0x1402x2b[_0x83aa[102]]+ _0x83aa[103]+ _0x1402x2c;if(_0x1402x2b[_0x83aa[93]]=== _0x83aa[104]){return _0x1402x2c}else {return getReportPath(_[_0x83aa[77]](_0x1402x1f,{id:_0x1402x2b[_0x83aa[93]]}),_0x1402x1f,_0x1402x2c)}}exports[_0x83aa[105]]= function(_0x1402x10,_0x1402x11){return CustomReport[_0x83aa[53]](_0x83aa[52])[_0x83aa[51]](_0x1402x10[_0x83aa[50]][_0x83aa[49]])[_0x83aa[22]](function(_0x1402x19){if(!_0x1402x19){return _0x1402x11[_0x83aa[37]](404)};return _0x1402x11[_0x83aa[20]](_0x1402x19)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[106]]= function(_0x1402x10,_0x1402x11){return CustomReport[_0x83aa[53]]({method:[_0x83aa[109],{CustomReportId:_0x1402x10[_0x83aa[50]][_0x83aa[49]]}]})[_0x83aa[51]](_0x1402x10[_0x83aa[50]][_0x83aa[49]],{attributes:[_0x83aa[107],_0x83aa[108],_0x83aa[94],_0x83aa[93],_0x83aa[44]]})[_0x83aa[22]](function(_0x1402x19){if(!_0x1402x19){return _0x1402x11[_0x83aa[37]](404)};return _0x1402x11[_0x83aa[20]](_0x1402x19)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[110]]= function(_0x1402x10,_0x1402x11){var _0x1402x2e;return sequelize[_0x83aa[115]](function(_0x1402x2f){return CustomReport[_0x83aa[53]](_0x83aa[52])[_0x83aa[51]](_0x1402x10[_0x83aa[50]][_0x83aa[49]])[_0x83aa[22]](function(_0x1402x19){if(!_0x1402x19){return _0x1402x11[_0x83aa[37]](404)};var _0x1402x30=_0x1402x19[_0x83aa[45]];delete _0x1402x30[_0x83aa[49]];delete _0x1402x30[_0x83aa[111]];delete _0x1402x30[_0x83aa[112]];_0x1402x30[_0x83aa[93]]= _0x1402x10[_0x83aa[113]][_0x83aa[93]];_0x1402x2e= _[_0x83aa[114]](_0x1402x30.Fields,_0x83aa[45]);return CustomReport[_0x83aa[101]](_0x1402x30,{transaction:_0x1402x2f})})[_0x83aa[22]](function(_0x1402x19){return [_0x1402x19,_0x1402x2e]})[_0x83aa[34]](createFields(_0x1402x2f))})[_0x83aa[22]](function(){return _0x1402x11[_0x83aa[37]](201)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[101]]= function(_0x1402x10,_0x1402x11){var _0x1402x17;return sequelize[_0x83aa[115]](function(_0x1402x2f){return CustomReport[_0x83aa[101]](_0x1402x10[_0x83aa[113]],{transaction:_0x1402x2f})[_0x83aa[22]](function(_0x1402x19){_0x1402x17= _0x1402x19;return [_0x1402x17,_0x1402x10[_0x83aa[113]][_0x83aa[116]]]})[_0x83aa[34]](createFields(_0x1402x2f))})[_0x83aa[22]](function(){return _0x1402x11[_0x83aa[21]](201)[_0x83aa[20]](_0x1402x17)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[117]]= function(_0x1402x10,_0x1402x11){var _0x1402x17;return sequelize[_0x83aa[115]](function(_0x1402x2f){return CustomReport[_0x83aa[101]](_0x1402x10[_0x83aa[113]],{transaction:_0x1402x2f})[_0x83aa[22]](function(_0x1402x19){_0x1402x17= _0x1402x19;return [_0x1402x17,_0x1402x10[_0x83aa[113]][_0x83aa[116]]]})[_0x83aa[34]](createImportFields(_0x1402x2f))})[_0x83aa[22]](function(){return _0x1402x11[_0x83aa[21]](201)[_0x83aa[20]](_0x1402x17)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[118]]= function(_0x1402x10,_0x1402x11,_0x1402x12){if(_0x1402x10[_0x83aa[113]][_0x83aa[49]]){delete _0x1402x10[_0x83aa[113]][_0x83aa[49]]};var _0x1402x17;return sequelize[_0x83aa[115]](function(_0x1402x2f){return CustomReport[_0x83aa[51]](_0x1402x10[_0x83aa[50]][_0x83aa[49]])[_0x83aa[22]](function(_0x1402x19){if(!_0x1402x19){return _0x1402x11[_0x83aa[37]](404)};var _0x1402x31=_[_0x83aa[119]](_0x1402x19,_0x1402x10[_0x83aa[113]]);return _0x1402x19[_0x83aa[120]]({transaction:_0x1402x2f})})[_0x83aa[22]](function(_0x1402x19){_0x1402x17= _0x1402x19;if(_0x1402x10[_0x83aa[113]][_0x83aa[116]]){return ReportField[_0x83aa[79]]({where:{CustomReportId:_0x1402x10[_0x83aa[50]][_0x83aa[49]]},transaction:_0x1402x2f})}})[_0x83aa[22]](function(){return [_0x1402x17,_0x1402x10[_0x83aa[113]][_0x83aa[116]]]})[_0x83aa[34]](createFields(_0x1402x2f))})[_0x83aa[22]](function(){return _0x1402x11[_0x83aa[37]](200)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};function createFields(_0x1402x2f){return function(_0x1402x19,_0x1402x33){if(_0x1402x33&& Array[_0x83aa[55]](_0x1402x33)&& _0x1402x33[_0x83aa[56]]){var _0x1402x34=reportBuildUtils[_0x83aa[121]](_0x1402x19[_0x83aa[44]]);if(_0x1402x34){var _0x1402x35;return _0x1402x34[_0x83aa[134]]()[_0x83aa[22]](function(_0x1402x3a){_0x1402x35= _[_0x83aa[132]](_0x1402x3a);return Metric[_0x83aa[133]]()})[_0x83aa[22]](function(_0x1402x36){var _0x1402x37=[];_0x1402x36= _[_0x83aa[114]](_0x1402x36,_0x83aa[45]);_0x1402x33[_0x83aa[64]](function(_0x1402x38){_0x1402x38[_0x83aa[122]]= _0x1402x19[_0x83aa[49]];if(_0x1402x38[_0x83aa[123]]){var _0x1402x39=_[_0x83aa[77]](_0x1402x36,{id:_0x1402x38[_0x83aa[123]]});if(_0x1402x39){_0x1402x38[_0x83aa[124]]= _0x1402x39[_0x83aa[125]];_0x1402x37[_0x83aa[80]](ReportField[_0x83aa[101]](_0x1402x38,{transaction:_0x1402x2f}))}else {throw  new sequelize.Error(_0x83aa[126]+ _0x1402x38[_0x83aa[123]]+ _0x83aa[127])}}else {if(_[_0x83aa[128]](_0x1402x35,_0x1402x38[_0x83aa[124]])|| _0x1402x38[_0x83aa[129]]){_0x1402x37[_0x83aa[80]](ReportField[_0x83aa[101]](_0x1402x38,{transaction:_0x1402x2f}))}else {throw  new sequelize.Error(_0x83aa[130]+ _0x1402x38[_0x83aa[124]]+ _0x83aa[131])}}});return _0x1402x37})[_0x83aa[32]]()}else {throw  new sequelize.Error(_0x83aa[135])}}}}function createImportFields(_0x1402x2f){return function(_0x1402x19,_0x1402x33){if(_0x1402x33&& Array[_0x83aa[55]](_0x1402x33)&& _0x1402x33[_0x83aa[56]]){var _0x1402x34=reportBuildUtils[_0x83aa[121]](_0x1402x19[_0x83aa[44]]);if(_0x1402x34){var _0x1402x35;return _0x1402x34[_0x83aa[134]]()[_0x83aa[22]](function(_0x1402x3a){_0x1402x35= _[_0x83aa[132]](_0x1402x3a);var _0x1402x37=[];var _0x1402x3c;if(_[_0x83aa[138]](_0x1402x33,function(_0x1402x38){return _[_0x83aa[137]](_0x1402x38,_0x83aa[136])})){_0x1402x3c= _0x83aa[139]}else {if(_[_0x83aa[138]](_0x1402x33,function(_0x1402x38){return _[_0x83aa[137]](_0x1402x38,_0x83aa[123])})){_0x1402x3c= _0x83aa[7]}else {throw  new sequelize.Error(_0x83aa[140])}};var _0x1402x3d=_[_0x83aa[142]](_0x1402x33,_0x1402x3c+ _0x83aa[141]);_[_0x83aa[63]](_0x1402x3d,function(_0x1402x3e,_0x1402x1e){if(_0x1402x1e!== _0x83aa[143]&& _0x1402x1e!== _0x83aa[144]){_0x1402x3e[0][_0x1402x3c][_0x83aa[145]][_0x83aa[64]](function(_0x1402x38){_0x1402x38[_0x83aa[122]]= _0x1402x19[_0x83aa[49]]});_0x1402x3e[0][_0x1402x3c][_0x83aa[94]]+= _0x83aa[146]+ sr({length:5});_0x1402x37[_0x83aa[80]](Metric[_0x83aa[101]](_0x1402x3e[0][_0x1402x3c],{include:[{model:ReportField,as:_0x83aa[145]}],transaction:_0x1402x2f}))}else {_0x1402x3e[_0x83aa[64]](function(_0x1402x38){if(_[_0x83aa[128]](_0x1402x35,_0x1402x38[_0x83aa[124]])|| _0x1402x38[_0x83aa[129]]){_0x1402x38[_0x83aa[122]]= _0x1402x19[_0x83aa[49]];_0x1402x37[_0x83aa[80]](ReportField[_0x83aa[101]](_0x1402x38,{transaction:_0x1402x2f}))}else {throw  new sequelize.Error(_0x83aa[130]+ _0x1402x38[_0x83aa[124]]+ _0x83aa[131])}})}});return _0x1402x37})[_0x83aa[32]]()}else {throw  new sequelize.Error(_0x83aa[135])}}}}exports[_0x83aa[79]]= function(_0x1402x10,_0x1402x11){return CustomReport[_0x83aa[51]](_0x1402x10[_0x83aa[50]][_0x83aa[49]])[_0x83aa[22]](function(_0x1402x19){if(!_0x1402x19){return _0x1402x11[_0x83aa[37]](404)};return _0x1402x19[_0x83aa[79]]()})[_0x83aa[22]](function(){return _0x1402x11[_0x83aa[37]](204)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};exports[_0x83aa[147]]= function(_0x1402x10,_0x1402x11){return CustomReport[_0x83aa[79]]({where:{id:_0x1402x10[_0x83aa[23]][_0x83aa[148]]},individualHooks:true})[_0x83aa[22]](function(){return _0x1402x11[_0x83aa[37]](204)})[_0x83aa[19]](function(_0x1402x13){return handleError(_0x1402x11,_0x1402x13)})};function handleError(_0x1402x11,_0x1402x13){logger[_0x83aa[29]](_0x1402x13[_0x83aa[28]]);return _0x1402x11[_0x83aa[21]](500)[_0x83aa[20]](_0x1402x13)}
\ No newline at end of file