Built motion from commit 832e619.|0.0.137
[motion.git] / server / api / custom_report / custom_report.controller.js
index 8321b8a..ec987aa 100644 (file)
@@ -1 +1 @@
-var _0x6429=["\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","\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","\x6C\x6F\x67","\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","\x66\x6F\x75\x6E\x64\x20\x72\x65\x70\x6F\x72\x74","\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","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\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","\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","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\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"];_0x6429[0];var _=require(_0x6429[1]);var util=require(_0x6429[2]);var sequelize=require(_0x6429[4])[_0x6429[3]];var CustomReport=require(_0x6429[4])[_0x6429[5]];var ReportField=require(_0x6429[4])[_0x6429[6]];var Metric=require(_0x6429[4])[_0x6429[7]];var ExtractedReport=require(_0x6429[4])[_0x6429[8]];var extractUtils=require(_0x6429[9]);var reportBuildUtils=require(_0x6429[10]);var Util=require(_0x6429[11]);var sr=require(_0x6429[12]);var moment=require(_0x6429[13]);var cp=require(_0x6429[14]);var ReportTree=require(_0x6429[4])[_0x6429[15]];exports[_0x6429[16]]= function(_0xdacfxf,_0xdacfx10,_0xdacfx11){return CustomReport[_0x6429[23]](Util[_0x6429[22]](_0xdacfxf[_0x6429[21]],{deletedAt:null}))[_0x6429[20]](function(_0xdacfx13){_0xdacfx10[_0x6429[19]](200)[_0x6429[18]](_0xdacfx13)})[_0x6429[17]](function(_0xdacfx12){return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[24]]= function(_0xdacfxf,_0xdacfx10){return Promise[_0x6429[29]]([])[_0x6429[20]](getQuery(_0xdacfxf,_0xdacfx10))[_0x6429[20]](function(_0xdacfx14){if(_0xdacfx14){switch(_0xdacfx14){case _0x6429[28]:_0xdacfx14= _0x6429[27];break;default:}};_0xdacfx10[_0x6429[19]](200)[_0x6429[18]]({query:_0xdacfx14})})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0x6429[25],_0xdacfx12)})};function getQuery(_0xdacfxf,_0xdacfx10){var _0xdacfx16;return function(){return CustomReport[_0x6429[51]](_0x6429[50])[_0x6429[49]](_0xdacfxf[_0x6429[48]][_0x6429[47]])[_0x6429[20]](function(_0xdacfx18){console[_0x6429[26]](_0x6429[34]);if(!_0xdacfx18){return _0xdacfx10[_0x6429[35]](404)};if(_0xdacfxf[_0x6429[21]][_0x6429[36]]&& _0xdacfxf[_0x6429[21]][_0x6429[36]]=== _0x6429[37]){_0xdacfxf[_0x6429[21]][_0x6429[38]]= moment()[_0x6429[40]](_0x6429[39]);_0xdacfxf[_0x6429[21]][_0x6429[41]]= moment()[_0x6429[40]](_0x6429[39]);_0xdacfx18[_0x6429[43]][_0x6429[42]]= _0xdacfx18[_0x6429[43]][_0x6429[42]][_0x6429[46]](_0x6429[44],_0x6429[45])};delete _0xdacfxf[_0x6429[21]][_0x6429[36]];_0xdacfx16= _0xdacfx18[_0x6429[43]];return _0xdacfx16[_0x6429[42]]})[_0x6429[20]](reportBuildUtils[_0x6429[33]](_0xdacfxf[_0x6429[32]]))[_0x6429[20]](function(_0xdacfx17){return [_0xdacfx17,_0xdacfx16]})[_0x6429[31]](reportBuildUtils[_0x6429[30]](_0xdacfxf[_0x6429[21]]))}}exports[_0x6429[52]]= function(_0xdacfxf,_0xdacfx10){var _0xdacfx19;return Promise[_0x6429[29]]([])[_0x6429[20]](getQuery(_0xdacfxf,_0xdacfx10))[_0x6429[20]](reportBuildUtils[_0x6429[64]]())[_0x6429[20]](function(_0xdacfx1a){if(_0xdacfx1a&& _[_0x6429[53]](_0xdacfx1a)){_0xdacfx19= _0xdacfx1a[_0x6429[54]];if(_0xdacfxf[_0x6429[21]][_0x6429[55]]){_0xdacfx1a= _(_0xdacfx1a)[_0x6429[59]](_0xdacfxf[_0x6429[21]][_0x6429[58]]|| 0)[_0x6429[57]](_0xdacfxf[_0x6429[21]][_0x6429[55]])[_0x6429[56]]()};_[_0x6429[62]](_0xdacfx1a,function(_0xdacfx1b){_[_0x6429[61]](_0xdacfx1b,function(_0xdacfx1c,_0xdacfx1d){if(_0xdacfx1c instanceof  Date){_0xdacfx1b[_0xdacfx1d]= moment(_0xdacfx1c)[_0x6429[40]](_0x6429[60]).toString()}})});_0xdacfx10[_0x6429[19]](200)[_0x6429[18]]({rows:_0xdacfx1a,count:_0xdacfx19})}else {return handleError(_0xdacfx10,{message:_0xdacfx1a|| _0x6429[63]})}})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0xdacfx12);return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[65]]= function(_0xdacfxf,_0xdacfx10){docExtract(_0xdacfxf,_0xdacfx10,_0x6429[66])};exports[_0x6429[67]]= function(_0xdacfxf,_0xdacfx10){docExtract(_0xdacfxf,_0xdacfx10,_0x6429[68])};exports[_0x6429[69]]= function(_0xdacfxf,_0xdacfx10){return ReportTree[_0x6429[49]](2)[_0x6429[20]](function(_0xdacfx1e){_0xdacfx1e= JSON[_0x6429[71]](_0xdacfx1e[_0x6429[70]]);var _0xdacfx1f=_[_0x6429[72]](_0xdacfx1e,{id:_0xdacfxf[_0x6429[48]][_0x6429[47]]});if(!_0xdacfx1f){throw  new Error(_0x6429[73])};var _0xdacfx20=[];findSubNodes(_0xdacfx1f,_0xdacfx1e,_0xdacfx20);console[_0x6429[26]](_0xdacfx20);return CustomReport[_0x6429[74]]({where:{parent:_0xdacfx20},individualHooks:true})})[_0x6429[20]](function(){return _0xdacfx10[_0x6429[35]](200)})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0xdacfx12);return handleError(_0xdacfx10,_0xdacfx12)})};function findSubNodes(_0xdacfx1f,_0xdacfx1e,_0xdacfx22){_0xdacfx22[_0x6429[75]](_0xdacfx1f[_0x6429[47]]);var _0xdacfx23=_[_0x6429[76]](_0xdacfx1e,{parent:_0xdacfx1f[_0x6429[47]]});if(!_0xdacfx23|| !_0xdacfx23[_0x6429[54]]){return};_[_0x6429[62]](_0xdacfx23,function(_0xdacfx24){findSubNodes(_0xdacfx24,_0xdacfx1e,_0xdacfx22)})}function docExtract(_0xdacfxf,_0xdacfx10,_0xdacfx26){var _0xdacfx18;CustomReport[_0x6429[51]](_0x6429[50])[_0x6429[49]](_0xdacfxf[_0x6429[48]][_0x6429[47]])[_0x6429[20]](function(_0xdacfx16){if(!_0xdacfx16){return _0xdacfx10[_0x6429[35]](404)};_0xdacfx18= _0xdacfx16;return ReportTree[_0x6429[49]](2)})[_0x6429[20]](function(_0xdacfx1e){_0xdacfx1e= JSON[_0x6429[71]](_0xdacfx1e[_0x6429[70]]);var _0xdacfx2a=_[_0x6429[72]](_0xdacfx1e,{id:_0xdacfx18[_0x6429[87]]});var _0xdacfx2b=getReportPath(_0xdacfx2a,_0xdacfx1e,_0xdacfx18[_0x6429[88]]);if(_0xdacfxf[_0x6429[21]][_0x6429[36]]&& _0xdacfxf[_0x6429[21]][_0x6429[36]]=== _0x6429[37]){_0xdacfxf[_0x6429[21]][_0x6429[38]]= moment()[_0x6429[40]](_0x6429[39]);_0xdacfxf[_0x6429[21]][_0x6429[41]]= moment()[_0x6429[40]](_0x6429[39]);_0xdacfx18[_0x6429[43]][_0x6429[42]]= _0xdacfx18[_0x6429[43]][_0x6429[42]][_0x6429[46]](_0x6429[44],_0x6429[45])};delete _0xdacfxf[_0x6429[21]][_0x6429[36]];return [_0xdacfx18,ExtractedReport[_0x6429[94]]({name:_0xdacfx2b,startDate:_0xdacfxf[_0x6429[21]][_0x6429[38]]?_0xdacfxf[_0x6429[21]][_0x6429[38]]+ (_0xdacfxf[_0x6429[21]][_0x6429[89]]?_0x6429[90]+ _0xdacfxf[_0x6429[21]][_0x6429[89]]:_0x6429[91]):null,endDate:_0xdacfxf[_0x6429[21]][_0x6429[41]]?_0xdacfxf[_0x6429[21]][_0x6429[41]]+ (_0xdacfxf[_0x6429[21]][_0x6429[92]]?_0x6429[90]+ _0xdacfxf[_0x6429[21]][_0x6429[92]]:_0x6429[93]):null,output:_0xdacfx26,UserId:_0xdacfxf[_0x6429[32]][_0x6429[47]]})]})[_0x6429[31]](function(_0xdacfx18,_0xdacfx27){var _0xdacfx28=cp[_0x6429[78]](__dirname+ _0x6429[77]);_0xdacfx28[_0x6429[81]](_0x6429[84],function(_0xdacfx29){console[_0x6429[26]](_0x6429[85],_0xdacfx29);_0xdacfx28[_0x6429[86]]()})[_0x6429[81]](_0x6429[82],function(){console[_0x6429[26]](_0x6429[83])})[_0x6429[81]](_0x6429[79],function(_0xdacfx12){console[_0x6429[26]](_0x6429[80],_0xdacfx12)});_0xdacfx28[_0x6429[18]]({report:_0xdacfx18,query:_0xdacfxf[_0x6429[21]],extractedId:_0xdacfx27[_0x6429[47]],user:_0xdacfxf[_0x6429[32]],type:_0xdacfx26})})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0xdacfx12);return handleError(_0xdacfx10,_0xdacfx12)});return _0xdacfx10[_0x6429[35]](200)}function getReportPath(_0xdacfx2a,_0xdacfx1e,_0xdacfx2b){_0xdacfx2b= _0xdacfx2a[_0x6429[95]]+ _0x6429[96]+ _0xdacfx2b;if(_0xdacfx2a[_0x6429[87]]=== _0x6429[97]){return _0xdacfx2b}else {return getReportPath(_[_0x6429[72]](_0xdacfx1e,{id:_0xdacfx2a[_0x6429[87]]}),_0xdacfx1e,_0xdacfx2b)}}exports[_0x6429[98]]= function(_0xdacfxf,_0xdacfx10){return CustomReport[_0x6429[51]](_0x6429[50])[_0x6429[49]](_0xdacfxf[_0x6429[48]][_0x6429[47]])[_0x6429[20]](function(_0xdacfx18){if(!_0xdacfx18){return _0xdacfx10[_0x6429[35]](404)};return _0xdacfx10[_0x6429[18]](_0xdacfx18)})[_0x6429[17]](function(_0xdacfx12){return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[99]]= function(_0xdacfxf,_0xdacfx10){return CustomReport[_0x6429[51]]({method:[_0x6429[102],{CustomReportId:_0xdacfxf[_0x6429[48]][_0x6429[47]]}]})[_0x6429[49]](_0xdacfxf[_0x6429[48]][_0x6429[47]],{attributes:[_0x6429[100],_0x6429[101],_0x6429[88],_0x6429[87],_0x6429[42]]})[_0x6429[20]](function(_0xdacfx18){if(!_0xdacfx18){return _0xdacfx10[_0x6429[35]](404)};return _0xdacfx10[_0x6429[18]](_0xdacfx18)})[_0x6429[17]](function(_0xdacfx12){return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[103]]= function(_0xdacfxf,_0xdacfx10){var _0xdacfx2d;return sequelize[_0x6429[108]](function(_0xdacfx2e){return CustomReport[_0x6429[51]](_0x6429[50])[_0x6429[49]](_0xdacfxf[_0x6429[48]][_0x6429[47]])[_0x6429[20]](function(_0xdacfx18){if(!_0xdacfx18){return _0xdacfx10[_0x6429[35]](404)};var _0xdacfx2f=_0xdacfx18[_0x6429[43]];delete _0xdacfx2f[_0x6429[47]];delete _0xdacfx2f[_0x6429[104]];delete _0xdacfx2f[_0x6429[105]];_0xdacfx2f[_0x6429[87]]= _0xdacfxf[_0x6429[106]][_0x6429[87]];_0xdacfx2d= _[_0x6429[107]](_0xdacfx2f.Fields,_0x6429[43]);return CustomReport[_0x6429[94]](_0xdacfx2f,{transaction:_0xdacfx2e})})[_0x6429[20]](function(_0xdacfx18){return [_0xdacfx18,_0xdacfx2d]})[_0x6429[31]](createFields(_0xdacfx2e))})[_0x6429[20]](function(){return _0xdacfx10[_0x6429[35]](201)})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0xdacfx12);return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[94]]= function(_0xdacfxf,_0xdacfx10){var _0xdacfx16;return sequelize[_0x6429[108]](function(_0xdacfx2e){return CustomReport[_0x6429[94]](_0xdacfxf[_0x6429[106]],{transaction:_0xdacfx2e})[_0x6429[20]](function(_0xdacfx18){_0xdacfx16= _0xdacfx18;return [_0xdacfx16,_0xdacfxf[_0x6429[106]][_0x6429[109]]]})[_0x6429[31]](createFields(_0xdacfx2e))})[_0x6429[20]](function(){return _0xdacfx10[_0x6429[19]](201)[_0x6429[18]](_0xdacfx16)})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0xdacfx12);return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[110]]= function(_0xdacfxf,_0xdacfx10){var _0xdacfx16;return sequelize[_0x6429[108]](function(_0xdacfx2e){return CustomReport[_0x6429[94]](_0xdacfxf[_0x6429[106]],{transaction:_0xdacfx2e})[_0x6429[20]](function(_0xdacfx18){_0xdacfx16= _0xdacfx18;return [_0xdacfx16,_0xdacfxf[_0x6429[106]][_0x6429[109]]]})[_0x6429[31]](createImportFields(_0xdacfx2e))})[_0x6429[20]](function(){return _0xdacfx10[_0x6429[19]](201)[_0x6429[18]](_0xdacfx16)})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0xdacfx12);return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[111]]= function(_0xdacfxf,_0xdacfx10,_0xdacfx11){if(_0xdacfxf[_0x6429[106]][_0x6429[47]]){delete _0xdacfxf[_0x6429[106]][_0x6429[47]]};var _0xdacfx16;return sequelize[_0x6429[108]](function(_0xdacfx2e){return CustomReport[_0x6429[49]](_0xdacfxf[_0x6429[48]][_0x6429[47]])[_0x6429[20]](function(_0xdacfx18){if(!_0xdacfx18){return _0xdacfx10[_0x6429[35]](404)};var _0xdacfx30=_[_0x6429[112]](_0xdacfx18,_0xdacfxf[_0x6429[106]]);return _0xdacfx18[_0x6429[113]]({transaction:_0xdacfx2e})})[_0x6429[20]](function(_0xdacfx18){_0xdacfx16= _0xdacfx18;if(_0xdacfxf[_0x6429[106]][_0x6429[109]]){return ReportField[_0x6429[74]]({where:{CustomReportId:_0xdacfxf[_0x6429[48]][_0x6429[47]]},transaction:_0xdacfx2e})}})[_0x6429[20]](function(){return [_0xdacfx16,_0xdacfxf[_0x6429[106]][_0x6429[109]]]})[_0x6429[31]](createFields(_0xdacfx2e))})[_0x6429[20]](function(){return _0xdacfx10[_0x6429[35]](200)})[_0x6429[17]](function(_0xdacfx12){console[_0x6429[26]](_0xdacfx12);return handleError(_0xdacfx10,_0xdacfx12)})};function createFields(_0xdacfx2e){return function(_0xdacfx18,_0xdacfx32){if(_0xdacfx32&& Array[_0x6429[53]](_0xdacfx32)&& _0xdacfx32[_0x6429[54]]){var _0xdacfx33=reportBuildUtils[_0x6429[114]](_0xdacfx18[_0x6429[42]]);if(_0xdacfx33){var _0xdacfx34;return _0xdacfx33[_0x6429[127]]()[_0x6429[20]](function(_0xdacfx39){_0xdacfx34= _[_0x6429[125]](_0xdacfx39);return Metric[_0x6429[126]]()})[_0x6429[20]](function(_0xdacfx35){var _0xdacfx36=[];_0xdacfx35= _[_0x6429[107]](_0xdacfx35,_0x6429[43]);_0xdacfx32[_0x6429[62]](function(_0xdacfx37){_0xdacfx37[_0x6429[115]]= _0xdacfx18[_0x6429[47]];if(_0xdacfx37[_0x6429[116]]){var _0xdacfx38=_[_0x6429[72]](_0xdacfx35,{id:_0xdacfx37[_0x6429[116]]});if(_0xdacfx38){_0xdacfx37[_0x6429[117]]= _0xdacfx38[_0x6429[118]];_0xdacfx36[_0x6429[75]](ReportField[_0x6429[94]](_0xdacfx37,{transaction:_0xdacfx2e}))}else {throw  new sequelize.Error(_0x6429[119]+ _0xdacfx37[_0x6429[116]]+ _0x6429[120])}}else {if(_[_0x6429[121]](_0xdacfx34,_0xdacfx37[_0x6429[117]])|| _0xdacfx37[_0x6429[122]]){_0xdacfx36[_0x6429[75]](ReportField[_0x6429[94]](_0xdacfx37,{transaction:_0xdacfx2e}))}else {throw  new sequelize.Error(_0x6429[123]+ _0xdacfx37[_0x6429[117]]+ _0x6429[124])}}});return _0xdacfx36})[_0x6429[29]]()}else {throw  new sequelize.Error(_0x6429[128])}}}}function createImportFields(_0xdacfx2e){return function(_0xdacfx18,_0xdacfx32){if(_0xdacfx32&& Array[_0x6429[53]](_0xdacfx32)&& _0xdacfx32[_0x6429[54]]){var _0xdacfx33=reportBuildUtils[_0x6429[114]](_0xdacfx18[_0x6429[42]]);if(_0xdacfx33){var _0xdacfx34;return _0xdacfx33[_0x6429[127]]()[_0x6429[20]](function(_0xdacfx39){_0xdacfx34= _[_0x6429[125]](_0xdacfx39);var _0xdacfx36=[];var _0xdacfx3b;if(_[_0x6429[131]](_0xdacfx32,function(_0xdacfx37){return _[_0x6429[130]](_0xdacfx37,_0x6429[129])})){_0xdacfx3b= _0x6429[132]}else {if(_[_0x6429[131]](_0xdacfx32,function(_0xdacfx37){return _[_0x6429[130]](_0xdacfx37,_0x6429[116])})){_0xdacfx3b= _0x6429[7]}else {throw  new sequelize.Error(_0x6429[133])}};var _0xdacfx3c=_[_0x6429[135]](_0xdacfx32,_0xdacfx3b+ _0x6429[134]);_[_0x6429[61]](_0xdacfx3c,function(_0xdacfx3d,_0xdacfx1d){if(_0xdacfx1d!== _0x6429[136]&& _0xdacfx1d!== _0x6429[137]){_0xdacfx3d[0][_0xdacfx3b][_0x6429[138]][_0x6429[62]](function(_0xdacfx37){_0xdacfx37[_0x6429[115]]= _0xdacfx18[_0x6429[47]]});_0xdacfx3d[0][_0xdacfx3b][_0x6429[88]]+= _0x6429[139]+ sr({length:5});_0xdacfx36[_0x6429[75]](Metric[_0x6429[94]](_0xdacfx3d[0][_0xdacfx3b],{include:[{model:ReportField,as:_0x6429[138]}],transaction:_0xdacfx2e}))}else {_0xdacfx3d[_0x6429[62]](function(_0xdacfx37){if(_[_0x6429[121]](_0xdacfx34,_0xdacfx37[_0x6429[117]])|| _0xdacfx37[_0x6429[122]]){_0xdacfx37[_0x6429[115]]= _0xdacfx18[_0x6429[47]];_0xdacfx36[_0x6429[75]](ReportField[_0x6429[94]](_0xdacfx37,{transaction:_0xdacfx2e}))}else {throw  new sequelize.Error(_0x6429[123]+ _0xdacfx37[_0x6429[117]]+ _0x6429[124])}})}});return _0xdacfx36})[_0x6429[29]]()}else {throw  new sequelize.Error(_0x6429[128])}}}}exports[_0x6429[74]]= function(_0xdacfxf,_0xdacfx10){return CustomReport[_0x6429[49]](_0xdacfxf[_0x6429[48]][_0x6429[47]])[_0x6429[20]](function(_0xdacfx18){if(!_0xdacfx18){return _0xdacfx10[_0x6429[35]](404)};return _0xdacfx18[_0x6429[74]]()})[_0x6429[20]](function(){return _0xdacfx10[_0x6429[35]](204)})[_0x6429[17]](function(_0xdacfx12){return handleError(_0xdacfx10,_0xdacfx12)})};exports[_0x6429[140]]= function(_0xdacfxf,_0xdacfx10){return CustomReport[_0x6429[74]]({where:{id:_0xdacfxf[_0x6429[21]][_0x6429[141]]},individualHooks:true})[_0x6429[20]](function(){return _0xdacfx10[_0x6429[35]](204)})[_0x6429[17]](function(_0xdacfx12){return handleError(_0xdacfx10,_0xdacfx12)})};function handleError(_0xdacfx10,_0xdacfx12){return _0xdacfx10[_0x6429[19]](500)[_0x6429[18]](_0xdacfx12)}
\ No newline at end of file
+var _0xad48=["\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","\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","\x6C\x6F\x67","\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","\x66\x6F\x75\x6E\x64\x20\x72\x65\x70\x6F\x72\x74","\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","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\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","\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","\x6B\x69\x6C\x6C","\x70\x61\x72\x65\x6E\x74","\x6E\x61\x6D\x65","\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"];_0xad48[0];var _=require(_0xad48[1]);var util=require(_0xad48[2]);var sequelize=require(_0xad48[4])[_0xad48[3]];var CustomReport=require(_0xad48[4])[_0xad48[5]];var ReportField=require(_0xad48[4])[_0xad48[6]];var Metric=require(_0xad48[4])[_0xad48[7]];var ExtractedReport=require(_0xad48[4])[_0xad48[8]];var extractUtils=require(_0xad48[9]);var reportBuildUtils=require(_0xad48[10]);var Util=require(_0xad48[11]);var sr=require(_0xad48[12]);var moment=require(_0xad48[13]);var cp=require(_0xad48[14]);var ReportTree=require(_0xad48[4])[_0xad48[15]];exports[_0xad48[16]]= function(_0x3b9exf,_0x3b9ex10,_0x3b9ex11){return CustomReport[_0xad48[23]](Util[_0xad48[22]](_0x3b9exf[_0xad48[21]],{deletedAt:null}))[_0xad48[20]](function(_0x3b9ex13){_0x3b9ex10[_0xad48[19]](200)[_0xad48[18]](_0x3b9ex13)})[_0xad48[17]](function(_0x3b9ex12){return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[24]]= function(_0x3b9exf,_0x3b9ex10){return Promise[_0xad48[29]]([])[_0xad48[20]](getQuery(_0x3b9exf,_0x3b9ex10))[_0xad48[20]](function(_0x3b9ex14){if(_0x3b9ex14){switch(_0x3b9ex14){case _0xad48[28]:_0x3b9ex14= _0xad48[27];break;default:}};_0x3b9ex10[_0xad48[19]](200)[_0xad48[18]]({query:_0x3b9ex14})})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0xad48[25],_0x3b9ex12)})};function getQuery(_0x3b9exf,_0x3b9ex10){var _0x3b9ex16;return function(){return CustomReport[_0xad48[51]](_0xad48[50])[_0xad48[49]](_0x3b9exf[_0xad48[48]][_0xad48[47]])[_0xad48[20]](function(_0x3b9ex18){console[_0xad48[26]](_0xad48[34]);if(!_0x3b9ex18){return _0x3b9ex10[_0xad48[35]](404)};if(_0x3b9exf[_0xad48[21]][_0xad48[36]]&& _0x3b9exf[_0xad48[21]][_0xad48[36]]=== _0xad48[37]){_0x3b9exf[_0xad48[21]][_0xad48[38]]= moment()[_0xad48[40]](_0xad48[39]);_0x3b9exf[_0xad48[21]][_0xad48[41]]= moment()[_0xad48[40]](_0xad48[39]);_0x3b9ex18[_0xad48[43]][_0xad48[42]]= _0x3b9ex18[_0xad48[43]][_0xad48[42]][_0xad48[46]](_0xad48[44],_0xad48[45])};delete _0x3b9exf[_0xad48[21]][_0xad48[36]];_0x3b9ex16= _0x3b9ex18[_0xad48[43]];return _0x3b9ex16[_0xad48[42]]})[_0xad48[20]](reportBuildUtils[_0xad48[33]](_0x3b9exf[_0xad48[32]]))[_0xad48[20]](function(_0x3b9ex17){return [_0x3b9ex17,_0x3b9ex16]})[_0xad48[31]](reportBuildUtils[_0xad48[30]](_0x3b9exf[_0xad48[21]]))}}exports[_0xad48[52]]= function(_0x3b9exf,_0x3b9ex10){var _0x3b9ex19;return Promise[_0xad48[29]]([])[_0xad48[20]](getQuery(_0x3b9exf,_0x3b9ex10))[_0xad48[20]](reportBuildUtils[_0xad48[64]]())[_0xad48[20]](function(_0x3b9ex1a){if(_0x3b9ex1a&& _[_0xad48[53]](_0x3b9ex1a)){_0x3b9ex19= _0x3b9ex1a[_0xad48[54]];if(_0x3b9exf[_0xad48[21]][_0xad48[55]]){_0x3b9ex1a= _(_0x3b9ex1a)[_0xad48[59]](_0x3b9exf[_0xad48[21]][_0xad48[58]]|| 0)[_0xad48[57]](_0x3b9exf[_0xad48[21]][_0xad48[55]])[_0xad48[56]]()};_[_0xad48[62]](_0x3b9ex1a,function(_0x3b9ex1b){_[_0xad48[61]](_0x3b9ex1b,function(_0x3b9ex1c,_0x3b9ex1d){if(_0x3b9ex1c instanceof  Date){_0x3b9ex1b[_0x3b9ex1d]= moment(_0x3b9ex1c)[_0xad48[40]](_0xad48[60]).toString()}})});_0x3b9ex10[_0xad48[19]](200)[_0xad48[18]]({rows:_0x3b9ex1a,count:_0x3b9ex19})}else {return handleError(_0x3b9ex10,{message:_0x3b9ex1a|| _0xad48[63]})}})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0x3b9ex12);return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[65]]= function(_0x3b9exf,_0x3b9ex10){docExtract(_0x3b9exf,_0x3b9ex10,_0xad48[66])};exports[_0xad48[67]]= function(_0x3b9exf,_0x3b9ex10){docExtract(_0x3b9exf,_0x3b9ex10,_0xad48[68])};exports[_0xad48[69]]= function(_0x3b9exf,_0x3b9ex10){return ReportTree[_0xad48[49]](2)[_0xad48[20]](function(_0x3b9ex1e){_0x3b9ex1e= JSON[_0xad48[71]](_0x3b9ex1e[_0xad48[70]]);var _0x3b9ex1f=_[_0xad48[72]](_0x3b9ex1e,{id:_0x3b9exf[_0xad48[48]][_0xad48[47]]});if(!_0x3b9ex1f){throw  new Error(_0xad48[73])};var _0x3b9ex20=[];findSubNodes(_0x3b9ex1f,_0x3b9ex1e,_0x3b9ex20);console[_0xad48[26]](_0x3b9ex20);return CustomReport[_0xad48[74]]({where:{parent:_0x3b9ex20},individualHooks:true})})[_0xad48[20]](function(){return _0x3b9ex10[_0xad48[35]](200)})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0x3b9ex12);return handleError(_0x3b9ex10,_0x3b9ex12)})};function findSubNodes(_0x3b9ex1f,_0x3b9ex1e,_0x3b9ex22){_0x3b9ex22[_0xad48[75]](_0x3b9ex1f[_0xad48[47]]);var _0x3b9ex23=_[_0xad48[76]](_0x3b9ex1e,{parent:_0x3b9ex1f[_0xad48[47]]});if(!_0x3b9ex23|| !_0x3b9ex23[_0xad48[54]]){return};_[_0xad48[62]](_0x3b9ex23,function(_0x3b9ex24){findSubNodes(_0x3b9ex24,_0x3b9ex1e,_0x3b9ex22)})}function docExtract(_0x3b9exf,_0x3b9ex10,_0x3b9ex26){var _0x3b9ex18;CustomReport[_0xad48[51]](_0xad48[50])[_0xad48[49]](_0x3b9exf[_0xad48[48]][_0xad48[47]])[_0xad48[20]](function(_0x3b9ex16){if(!_0x3b9ex16){return _0x3b9ex10[_0xad48[35]](404)};_0x3b9ex18= _0x3b9ex16;return ReportTree[_0xad48[49]](2)})[_0xad48[20]](function(_0x3b9ex1e){_0x3b9ex1e= JSON[_0xad48[71]](_0x3b9ex1e[_0xad48[70]]);var _0x3b9ex2a=_[_0xad48[72]](_0x3b9ex1e,{id:_0x3b9ex18[_0xad48[87]]});var _0x3b9ex2b=getReportPath(_0x3b9ex2a,_0x3b9ex1e,_0x3b9ex18[_0xad48[88]]);if(_0x3b9exf[_0xad48[21]][_0xad48[36]]&& _0x3b9exf[_0xad48[21]][_0xad48[36]]=== _0xad48[37]){_0x3b9exf[_0xad48[21]][_0xad48[38]]= moment()[_0xad48[40]](_0xad48[39]);_0x3b9exf[_0xad48[21]][_0xad48[41]]= moment()[_0xad48[40]](_0xad48[39]);_0x3b9ex18[_0xad48[43]][_0xad48[42]]= _0x3b9ex18[_0xad48[43]][_0xad48[42]][_0xad48[46]](_0xad48[44],_0xad48[45])};delete _0x3b9exf[_0xad48[21]][_0xad48[36]];return [_0x3b9ex18,ExtractedReport[_0xad48[94]]({name:_0x3b9ex2b,startDate:_0x3b9exf[_0xad48[21]][_0xad48[38]]?_0x3b9exf[_0xad48[21]][_0xad48[38]]+ (_0x3b9exf[_0xad48[21]][_0xad48[89]]?_0xad48[90]+ _0x3b9exf[_0xad48[21]][_0xad48[89]]:_0xad48[91]):null,endDate:_0x3b9exf[_0xad48[21]][_0xad48[41]]?_0x3b9exf[_0xad48[21]][_0xad48[41]]+ (_0x3b9exf[_0xad48[21]][_0xad48[92]]?_0xad48[90]+ _0x3b9exf[_0xad48[21]][_0xad48[92]]:_0xad48[93]):null,output:_0x3b9ex26,UserId:_0x3b9exf[_0xad48[32]][_0xad48[47]]})]})[_0xad48[31]](function(_0x3b9ex18,_0x3b9ex27){var _0x3b9ex28=cp[_0xad48[78]](__dirname+ _0xad48[77]);_0x3b9ex28[_0xad48[81]](_0xad48[84],function(_0x3b9ex29){console[_0xad48[26]](_0xad48[85],_0x3b9ex29);_0x3b9ex28[_0xad48[86]]()})[_0xad48[81]](_0xad48[82],function(){console[_0xad48[26]](_0xad48[83])})[_0xad48[81]](_0xad48[79],function(_0x3b9ex12){console[_0xad48[26]](_0xad48[80],_0x3b9ex12)});_0x3b9ex28[_0xad48[18]]({report:_0x3b9ex18,query:_0x3b9exf[_0xad48[21]],extractedId:_0x3b9ex27[_0xad48[47]],user:_0x3b9exf[_0xad48[32]],type:_0x3b9ex26})})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0x3b9ex12);return handleError(_0x3b9ex10,_0x3b9ex12)});return _0x3b9ex10[_0xad48[35]](200)}function getReportPath(_0x3b9ex2a,_0x3b9ex1e,_0x3b9ex2b){_0x3b9ex2b= _0x3b9ex2a[_0xad48[95]]+ _0xad48[96]+ _0x3b9ex2b;if(_0x3b9ex2a[_0xad48[87]]=== _0xad48[97]){return _0x3b9ex2b}else {return getReportPath(_[_0xad48[72]](_0x3b9ex1e,{id:_0x3b9ex2a[_0xad48[87]]}),_0x3b9ex1e,_0x3b9ex2b)}}exports[_0xad48[98]]= function(_0x3b9exf,_0x3b9ex10){return CustomReport[_0xad48[51]](_0xad48[50])[_0xad48[49]](_0x3b9exf[_0xad48[48]][_0xad48[47]])[_0xad48[20]](function(_0x3b9ex18){if(!_0x3b9ex18){return _0x3b9ex10[_0xad48[35]](404)};return _0x3b9ex10[_0xad48[18]](_0x3b9ex18)})[_0xad48[17]](function(_0x3b9ex12){return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[99]]= function(_0x3b9exf,_0x3b9ex10){return CustomReport[_0xad48[51]]({method:[_0xad48[102],{CustomReportId:_0x3b9exf[_0xad48[48]][_0xad48[47]]}]})[_0xad48[49]](_0x3b9exf[_0xad48[48]][_0xad48[47]],{attributes:[_0xad48[100],_0xad48[101],_0xad48[88],_0xad48[87],_0xad48[42]]})[_0xad48[20]](function(_0x3b9ex18){if(!_0x3b9ex18){return _0x3b9ex10[_0xad48[35]](404)};return _0x3b9ex10[_0xad48[18]](_0x3b9ex18)})[_0xad48[17]](function(_0x3b9ex12){return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[103]]= function(_0x3b9exf,_0x3b9ex10){var _0x3b9ex2d;return sequelize[_0xad48[108]](function(_0x3b9ex2e){return CustomReport[_0xad48[51]](_0xad48[50])[_0xad48[49]](_0x3b9exf[_0xad48[48]][_0xad48[47]])[_0xad48[20]](function(_0x3b9ex18){if(!_0x3b9ex18){return _0x3b9ex10[_0xad48[35]](404)};var _0x3b9ex2f=_0x3b9ex18[_0xad48[43]];delete _0x3b9ex2f[_0xad48[47]];delete _0x3b9ex2f[_0xad48[104]];delete _0x3b9ex2f[_0xad48[105]];_0x3b9ex2f[_0xad48[87]]= _0x3b9exf[_0xad48[106]][_0xad48[87]];_0x3b9ex2d= _[_0xad48[107]](_0x3b9ex2f.Fields,_0xad48[43]);return CustomReport[_0xad48[94]](_0x3b9ex2f,{transaction:_0x3b9ex2e})})[_0xad48[20]](function(_0x3b9ex18){return [_0x3b9ex18,_0x3b9ex2d]})[_0xad48[31]](createFields(_0x3b9ex2e))})[_0xad48[20]](function(){return _0x3b9ex10[_0xad48[35]](201)})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0x3b9ex12);return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[94]]= function(_0x3b9exf,_0x3b9ex10){var _0x3b9ex16;return sequelize[_0xad48[108]](function(_0x3b9ex2e){return CustomReport[_0xad48[94]](_0x3b9exf[_0xad48[106]],{transaction:_0x3b9ex2e})[_0xad48[20]](function(_0x3b9ex18){_0x3b9ex16= _0x3b9ex18;return [_0x3b9ex16,_0x3b9exf[_0xad48[106]][_0xad48[109]]]})[_0xad48[31]](createFields(_0x3b9ex2e))})[_0xad48[20]](function(){return _0x3b9ex10[_0xad48[19]](201)[_0xad48[18]](_0x3b9ex16)})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0x3b9ex12);return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[110]]= function(_0x3b9exf,_0x3b9ex10){var _0x3b9ex16;return sequelize[_0xad48[108]](function(_0x3b9ex2e){return CustomReport[_0xad48[94]](_0x3b9exf[_0xad48[106]],{transaction:_0x3b9ex2e})[_0xad48[20]](function(_0x3b9ex18){_0x3b9ex16= _0x3b9ex18;return [_0x3b9ex16,_0x3b9exf[_0xad48[106]][_0xad48[109]]]})[_0xad48[31]](createImportFields(_0x3b9ex2e))})[_0xad48[20]](function(){return _0x3b9ex10[_0xad48[19]](201)[_0xad48[18]](_0x3b9ex16)})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0x3b9ex12);return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[111]]= function(_0x3b9exf,_0x3b9ex10,_0x3b9ex11){if(_0x3b9exf[_0xad48[106]][_0xad48[47]]){delete _0x3b9exf[_0xad48[106]][_0xad48[47]]};var _0x3b9ex16;return sequelize[_0xad48[108]](function(_0x3b9ex2e){return CustomReport[_0xad48[49]](_0x3b9exf[_0xad48[48]][_0xad48[47]])[_0xad48[20]](function(_0x3b9ex18){if(!_0x3b9ex18){return _0x3b9ex10[_0xad48[35]](404)};var _0x3b9ex30=_[_0xad48[112]](_0x3b9ex18,_0x3b9exf[_0xad48[106]]);return _0x3b9ex18[_0xad48[113]]({transaction:_0x3b9ex2e})})[_0xad48[20]](function(_0x3b9ex18){_0x3b9ex16= _0x3b9ex18;if(_0x3b9exf[_0xad48[106]][_0xad48[109]]){return ReportField[_0xad48[74]]({where:{CustomReportId:_0x3b9exf[_0xad48[48]][_0xad48[47]]},transaction:_0x3b9ex2e})}})[_0xad48[20]](function(){return [_0x3b9ex16,_0x3b9exf[_0xad48[106]][_0xad48[109]]]})[_0xad48[31]](createFields(_0x3b9ex2e))})[_0xad48[20]](function(){return _0x3b9ex10[_0xad48[35]](200)})[_0xad48[17]](function(_0x3b9ex12){console[_0xad48[26]](_0x3b9ex12);return handleError(_0x3b9ex10,_0x3b9ex12)})};function createFields(_0x3b9ex2e){return function(_0x3b9ex18,_0x3b9ex32){if(_0x3b9ex32&& Array[_0xad48[53]](_0x3b9ex32)&& _0x3b9ex32[_0xad48[54]]){var _0x3b9ex33=reportBuildUtils[_0xad48[114]](_0x3b9ex18[_0xad48[42]]);if(_0x3b9ex33){var _0x3b9ex34;return _0x3b9ex33[_0xad48[127]]()[_0xad48[20]](function(_0x3b9ex39){_0x3b9ex34= _[_0xad48[125]](_0x3b9ex39);return Metric[_0xad48[126]]()})[_0xad48[20]](function(_0x3b9ex35){var _0x3b9ex36=[];_0x3b9ex35= _[_0xad48[107]](_0x3b9ex35,_0xad48[43]);_0x3b9ex32[_0xad48[62]](function(_0x3b9ex37){_0x3b9ex37[_0xad48[115]]= _0x3b9ex18[_0xad48[47]];if(_0x3b9ex37[_0xad48[116]]){var _0x3b9ex38=_[_0xad48[72]](_0x3b9ex35,{id:_0x3b9ex37[_0xad48[116]]});if(_0x3b9ex38){_0x3b9ex37[_0xad48[117]]= _0x3b9ex38[_0xad48[118]];_0x3b9ex36[_0xad48[75]](ReportField[_0xad48[94]](_0x3b9ex37,{transaction:_0x3b9ex2e}))}else {throw  new sequelize.Error(_0xad48[119]+ _0x3b9ex37[_0xad48[116]]+ _0xad48[120])}}else {if(_[_0xad48[121]](_0x3b9ex34,_0x3b9ex37[_0xad48[117]])|| _0x3b9ex37[_0xad48[122]]){_0x3b9ex36[_0xad48[75]](ReportField[_0xad48[94]](_0x3b9ex37,{transaction:_0x3b9ex2e}))}else {throw  new sequelize.Error(_0xad48[123]+ _0x3b9ex37[_0xad48[117]]+ _0xad48[124])}}});return _0x3b9ex36})[_0xad48[29]]()}else {throw  new sequelize.Error(_0xad48[128])}}}}function createImportFields(_0x3b9ex2e){return function(_0x3b9ex18,_0x3b9ex32){if(_0x3b9ex32&& Array[_0xad48[53]](_0x3b9ex32)&& _0x3b9ex32[_0xad48[54]]){var _0x3b9ex33=reportBuildUtils[_0xad48[114]](_0x3b9ex18[_0xad48[42]]);if(_0x3b9ex33){var _0x3b9ex34;return _0x3b9ex33[_0xad48[127]]()[_0xad48[20]](function(_0x3b9ex39){_0x3b9ex34= _[_0xad48[125]](_0x3b9ex39);var _0x3b9ex36=[];var _0x3b9ex3b;if(_[_0xad48[131]](_0x3b9ex32,function(_0x3b9ex37){return _[_0xad48[130]](_0x3b9ex37,_0xad48[129])})){_0x3b9ex3b= _0xad48[132]}else {if(_[_0xad48[131]](_0x3b9ex32,function(_0x3b9ex37){return _[_0xad48[130]](_0x3b9ex37,_0xad48[116])})){_0x3b9ex3b= _0xad48[7]}else {throw  new sequelize.Error(_0xad48[133])}};var _0x3b9ex3c=_[_0xad48[135]](_0x3b9ex32,_0x3b9ex3b+ _0xad48[134]);_[_0xad48[61]](_0x3b9ex3c,function(_0x3b9ex3d,_0x3b9ex1d){if(_0x3b9ex1d!== _0xad48[136]&& _0x3b9ex1d!== _0xad48[137]){_0x3b9ex3d[0][_0x3b9ex3b][_0xad48[138]][_0xad48[62]](function(_0x3b9ex37){_0x3b9ex37[_0xad48[115]]= _0x3b9ex18[_0xad48[47]]});_0x3b9ex3d[0][_0x3b9ex3b][_0xad48[88]]+= _0xad48[139]+ sr({length:5});_0x3b9ex36[_0xad48[75]](Metric[_0xad48[94]](_0x3b9ex3d[0][_0x3b9ex3b],{include:[{model:ReportField,as:_0xad48[138]}],transaction:_0x3b9ex2e}))}else {_0x3b9ex3d[_0xad48[62]](function(_0x3b9ex37){if(_[_0xad48[121]](_0x3b9ex34,_0x3b9ex37[_0xad48[117]])|| _0x3b9ex37[_0xad48[122]]){_0x3b9ex37[_0xad48[115]]= _0x3b9ex18[_0xad48[47]];_0x3b9ex36[_0xad48[75]](ReportField[_0xad48[94]](_0x3b9ex37,{transaction:_0x3b9ex2e}))}else {throw  new sequelize.Error(_0xad48[123]+ _0x3b9ex37[_0xad48[117]]+ _0xad48[124])}})}});return _0x3b9ex36})[_0xad48[29]]()}else {throw  new sequelize.Error(_0xad48[128])}}}}exports[_0xad48[74]]= function(_0x3b9exf,_0x3b9ex10){return CustomReport[_0xad48[49]](_0x3b9exf[_0xad48[48]][_0xad48[47]])[_0xad48[20]](function(_0x3b9ex18){if(!_0x3b9ex18){return _0x3b9ex10[_0xad48[35]](404)};return _0x3b9ex18[_0xad48[74]]()})[_0xad48[20]](function(){return _0x3b9ex10[_0xad48[35]](204)})[_0xad48[17]](function(_0x3b9ex12){return handleError(_0x3b9ex10,_0x3b9ex12)})};exports[_0xad48[140]]= function(_0x3b9exf,_0x3b9ex10){return CustomReport[_0xad48[74]]({where:{id:_0x3b9exf[_0xad48[21]][_0xad48[141]]},individualHooks:true})[_0xad48[20]](function(){return _0x3b9ex10[_0xad48[35]](204)})[_0xad48[17]](function(_0x3b9ex12){return handleError(_0x3b9ex10,_0x3b9ex12)})};function handleError(_0x3b9ex10,_0x3b9ex12){return _0x3b9ex10[_0xad48[19]](500)[_0xad48[18]](_0x3b9ex12)}
\ No newline at end of file