Built motion from commit ee17993.|1.0.6
[motion.git] / server / api / custom_report / custom_report.controller.js
index 4f487f1..84af478 100644 (file)
@@ -1 +1 @@
-var _0x9daa=["\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"];_0x9daa[0];var _=require(_0x9daa[1]);var util=require(_0x9daa[2]);var sequelize=require(_0x9daa[4])[_0x9daa[3]];var CustomReport=require(_0x9daa[4])[_0x9daa[5]];var ReportField=require(_0x9daa[4])[_0x9daa[6]];var Metric=require(_0x9daa[4])[_0x9daa[7]];var ExtractedReport=require(_0x9daa[4])[_0x9daa[8]];var extractUtils=require(_0x9daa[9]);var reportBuildUtils=require(_0x9daa[10]);var Util=require(_0x9daa[11]);var sr=require(_0x9daa[12]);var moment=require(_0x9daa[13]);var cp=require(_0x9daa[14]);var ReportTree=require(_0x9daa[4])[_0x9daa[15]];exports[_0x9daa[16]]= function(_0x555fxf,_0x555fx10,_0x555fx11){return CustomReport[_0x9daa[23]](Util[_0x9daa[22]](_0x555fxf[_0x9daa[21]],{deletedAt:null}))[_0x9daa[20]](function(_0x555fx13){_0x555fx10[_0x9daa[19]](200)[_0x9daa[18]](_0x555fx13)})[_0x9daa[17]](function(_0x555fx12){return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[24]]= function(_0x555fxf,_0x555fx10){return Promise[_0x9daa[29]]([])[_0x9daa[20]](getQuery(_0x555fxf,_0x555fx10))[_0x9daa[20]](function(_0x555fx14){if(_0x555fx14){switch(_0x555fx14){case _0x9daa[28]:_0x555fx14= _0x9daa[27];break;default:}};_0x555fx10[_0x9daa[19]](200)[_0x9daa[18]]({query:_0x555fx14})})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x9daa[25],_0x555fx12)})};function getQuery(_0x555fxf,_0x555fx10){var _0x555fx16;return function(){return CustomReport[_0x9daa[51]](_0x9daa[50])[_0x9daa[49]](_0x555fxf[_0x9daa[48]][_0x9daa[47]])[_0x9daa[20]](function(_0x555fx18){console[_0x9daa[26]](_0x9daa[34]);if(!_0x555fx18){return _0x555fx10[_0x9daa[35]](404)};if(_0x555fxf[_0x9daa[21]][_0x9daa[36]]&& _0x555fxf[_0x9daa[21]][_0x9daa[36]]=== _0x9daa[37]){_0x555fxf[_0x9daa[21]][_0x9daa[38]]= moment()[_0x9daa[40]](_0x9daa[39]);_0x555fxf[_0x9daa[21]][_0x9daa[41]]= moment()[_0x9daa[40]](_0x9daa[39]);_0x555fx18[_0x9daa[43]][_0x9daa[42]]= _0x555fx18[_0x9daa[43]][_0x9daa[42]][_0x9daa[46]](_0x9daa[44],_0x9daa[45])};delete _0x555fxf[_0x9daa[21]][_0x9daa[36]];_0x555fx16= _0x555fx18[_0x9daa[43]];return _0x555fx16[_0x9daa[42]]})[_0x9daa[20]](reportBuildUtils[_0x9daa[33]](_0x555fxf[_0x9daa[32]]))[_0x9daa[20]](function(_0x555fx17){return [_0x555fx17,_0x555fx16]})[_0x9daa[31]](reportBuildUtils[_0x9daa[30]](_0x555fxf[_0x9daa[21]]))}}exports[_0x9daa[52]]= function(_0x555fxf,_0x555fx10){var _0x555fx19;return Promise[_0x9daa[29]]([])[_0x9daa[20]](getQuery(_0x555fxf,_0x555fx10))[_0x9daa[20]](reportBuildUtils[_0x9daa[64]]())[_0x9daa[20]](function(_0x555fx1a){if(_0x555fx1a&& _[_0x9daa[53]](_0x555fx1a)){_0x555fx19= _0x555fx1a[_0x9daa[54]];if(_0x555fxf[_0x9daa[21]][_0x9daa[55]]){_0x555fx1a= _(_0x555fx1a)[_0x9daa[59]](_0x555fxf[_0x9daa[21]][_0x9daa[58]]|| 0)[_0x9daa[57]](_0x555fxf[_0x9daa[21]][_0x9daa[55]])[_0x9daa[56]]()};_[_0x9daa[62]](_0x555fx1a,function(_0x555fx1b){_[_0x9daa[61]](_0x555fx1b,function(_0x555fx1c,_0x555fx1d){if(_0x555fx1c instanceof  Date){_0x555fx1b[_0x555fx1d]= moment(_0x555fx1c)[_0x9daa[40]](_0x9daa[60]).toString()}})});_0x555fx10[_0x9daa[19]](200)[_0x9daa[18]]({rows:_0x555fx1a,count:_0x555fx19})}else {return handleError(_0x555fx10,{message:_0x555fx1a|| _0x9daa[63]})}})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x555fx12);return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[65]]= function(_0x555fxf,_0x555fx10){docExtract(_0x555fxf,_0x555fx10,_0x9daa[66])};exports[_0x9daa[67]]= function(_0x555fxf,_0x555fx10){docExtract(_0x555fxf,_0x555fx10,_0x9daa[68])};exports[_0x9daa[69]]= function(_0x555fxf,_0x555fx10){return ReportTree[_0x9daa[49]](2)[_0x9daa[20]](function(_0x555fx1e){_0x555fx1e= JSON[_0x9daa[71]](_0x555fx1e[_0x9daa[70]]);var _0x555fx1f=_[_0x9daa[72]](_0x555fx1e,{id:_0x555fxf[_0x9daa[48]][_0x9daa[47]]});if(!_0x555fx1f){throw  new Error(_0x9daa[73])};var _0x555fx20=[];findSubNodes(_0x555fx1f,_0x555fx1e,_0x555fx20);return CustomReport[_0x9daa[74]]({where:{parent:_0x555fx20},individualHooks:true})})[_0x9daa[20]](function(){return _0x555fx10[_0x9daa[35]](200)})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x555fx12);return handleError(_0x555fx10,_0x555fx12)})};function findSubNodes(_0x555fx1f,_0x555fx1e,_0x555fx22){_0x555fx22[_0x9daa[75]](_0x555fx1f[_0x9daa[47]]);var _0x555fx23=_[_0x9daa[76]](_0x555fx1e,{parent:_0x555fx1f[_0x9daa[47]]});if(!_0x555fx23|| !_0x555fx23[_0x9daa[54]]){return};_[_0x9daa[62]](_0x555fx23,function(_0x555fx24){findSubNodes(_0x555fx24,_0x555fx1e,_0x555fx22)})}function docExtract(_0x555fxf,_0x555fx10,_0x555fx26){var _0x555fx18;CustomReport[_0x9daa[51]](_0x9daa[50])[_0x9daa[49]](_0x555fxf[_0x9daa[48]][_0x9daa[47]])[_0x9daa[20]](function(_0x555fx16){if(!_0x555fx16){return _0x555fx10[_0x9daa[35]](404)};_0x555fx18= _0x555fx16;return ReportTree[_0x9daa[49]](2)})[_0x9daa[20]](function(_0x555fx1e){_0x555fx1e= JSON[_0x9daa[71]](_0x555fx1e[_0x9daa[70]]);var _0x555fx2a=_[_0x9daa[72]](_0x555fx1e,{id:_0x555fx18[_0x9daa[87]]});var _0x555fx2b=getReportPath(_0x555fx2a,_0x555fx1e,_0x555fx18[_0x9daa[88]]);if(_0x555fxf[_0x9daa[21]][_0x9daa[36]]&& _0x555fxf[_0x9daa[21]][_0x9daa[36]]=== _0x9daa[37]){_0x555fxf[_0x9daa[21]][_0x9daa[38]]= moment()[_0x9daa[40]](_0x9daa[39]);_0x555fxf[_0x9daa[21]][_0x9daa[41]]= moment()[_0x9daa[40]](_0x9daa[39]);_0x555fx18[_0x9daa[43]][_0x9daa[42]]= _0x555fx18[_0x9daa[43]][_0x9daa[42]][_0x9daa[46]](_0x9daa[44],_0x9daa[45])};delete _0x555fxf[_0x9daa[21]][_0x9daa[36]];return [_0x555fx18,ExtractedReport[_0x9daa[94]]({name:_0x555fx2b,startDate:_0x555fxf[_0x9daa[21]][_0x9daa[38]]?_0x555fxf[_0x9daa[21]][_0x9daa[38]]+ (_0x555fxf[_0x9daa[21]][_0x9daa[89]]?_0x9daa[90]+ _0x555fxf[_0x9daa[21]][_0x9daa[89]]:_0x9daa[91]):null,endDate:_0x555fxf[_0x9daa[21]][_0x9daa[41]]?_0x555fxf[_0x9daa[21]][_0x9daa[41]]+ (_0x555fxf[_0x9daa[21]][_0x9daa[92]]?_0x9daa[90]+ _0x555fxf[_0x9daa[21]][_0x9daa[92]]:_0x9daa[93]):null,output:_0x555fx26,UserId:_0x555fxf[_0x9daa[32]][_0x9daa[47]]})]})[_0x9daa[31]](function(_0x555fx18,_0x555fx27){var _0x555fx28=cp[_0x9daa[78]](__dirname+ _0x9daa[77]);_0x555fx28[_0x9daa[81]](_0x9daa[84],function(_0x555fx29){console[_0x9daa[26]](_0x9daa[85],_0x555fx29);_0x555fx28[_0x9daa[86]]()})[_0x9daa[81]](_0x9daa[82],function(){console[_0x9daa[26]](_0x9daa[83])})[_0x9daa[81]](_0x9daa[79],function(_0x555fx12){console[_0x9daa[26]](_0x9daa[80],_0x555fx12)});_0x555fx28[_0x9daa[18]]({report:_0x555fx18,query:_0x555fxf[_0x9daa[21]],extractedId:_0x555fx27[_0x9daa[47]],user:_0x555fxf[_0x9daa[32]],type:_0x555fx26})})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x555fx12);return handleError(_0x555fx10,_0x555fx12)});return _0x555fx10[_0x9daa[35]](200)}function getReportPath(_0x555fx2a,_0x555fx1e,_0x555fx2b){_0x555fx2b= _0x555fx2a[_0x9daa[95]]+ _0x9daa[96]+ _0x555fx2b;if(_0x555fx2a[_0x9daa[87]]=== _0x9daa[97]){return _0x555fx2b}else {return getReportPath(_[_0x9daa[72]](_0x555fx1e,{id:_0x555fx2a[_0x9daa[87]]}),_0x555fx1e,_0x555fx2b)}}exports[_0x9daa[98]]= function(_0x555fxf,_0x555fx10){return CustomReport[_0x9daa[51]](_0x9daa[50])[_0x9daa[49]](_0x555fxf[_0x9daa[48]][_0x9daa[47]])[_0x9daa[20]](function(_0x555fx18){if(!_0x555fx18){return _0x555fx10[_0x9daa[35]](404)};return _0x555fx10[_0x9daa[18]](_0x555fx18)})[_0x9daa[17]](function(_0x555fx12){return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[99]]= function(_0x555fxf,_0x555fx10){return CustomReport[_0x9daa[51]]({method:[_0x9daa[102],{CustomReportId:_0x555fxf[_0x9daa[48]][_0x9daa[47]]}]})[_0x9daa[49]](_0x555fxf[_0x9daa[48]][_0x9daa[47]],{attributes:[_0x9daa[100],_0x9daa[101],_0x9daa[88],_0x9daa[87],_0x9daa[42]]})[_0x9daa[20]](function(_0x555fx18){if(!_0x555fx18){return _0x555fx10[_0x9daa[35]](404)};return _0x555fx10[_0x9daa[18]](_0x555fx18)})[_0x9daa[17]](function(_0x555fx12){return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[103]]= function(_0x555fxf,_0x555fx10){var _0x555fx2d;return sequelize[_0x9daa[108]](function(_0x555fx2e){return CustomReport[_0x9daa[51]](_0x9daa[50])[_0x9daa[49]](_0x555fxf[_0x9daa[48]][_0x9daa[47]])[_0x9daa[20]](function(_0x555fx18){if(!_0x555fx18){return _0x555fx10[_0x9daa[35]](404)};var _0x555fx2f=_0x555fx18[_0x9daa[43]];delete _0x555fx2f[_0x9daa[47]];delete _0x555fx2f[_0x9daa[104]];delete _0x555fx2f[_0x9daa[105]];_0x555fx2f[_0x9daa[87]]= _0x555fxf[_0x9daa[106]][_0x9daa[87]];_0x555fx2d= _[_0x9daa[107]](_0x555fx2f.Fields,_0x9daa[43]);return CustomReport[_0x9daa[94]](_0x555fx2f,{transaction:_0x555fx2e})})[_0x9daa[20]](function(_0x555fx18){return [_0x555fx18,_0x555fx2d]})[_0x9daa[31]](createFields(_0x555fx2e))})[_0x9daa[20]](function(){return _0x555fx10[_0x9daa[35]](201)})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x555fx12);return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[94]]= function(_0x555fxf,_0x555fx10){var _0x555fx16;return sequelize[_0x9daa[108]](function(_0x555fx2e){return CustomReport[_0x9daa[94]](_0x555fxf[_0x9daa[106]],{transaction:_0x555fx2e})[_0x9daa[20]](function(_0x555fx18){_0x555fx16= _0x555fx18;return [_0x555fx16,_0x555fxf[_0x9daa[106]][_0x9daa[109]]]})[_0x9daa[31]](createFields(_0x555fx2e))})[_0x9daa[20]](function(){return _0x555fx10[_0x9daa[19]](201)[_0x9daa[18]](_0x555fx16)})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x555fx12);return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[110]]= function(_0x555fxf,_0x555fx10){var _0x555fx16;return sequelize[_0x9daa[108]](function(_0x555fx2e){return CustomReport[_0x9daa[94]](_0x555fxf[_0x9daa[106]],{transaction:_0x555fx2e})[_0x9daa[20]](function(_0x555fx18){_0x555fx16= _0x555fx18;return [_0x555fx16,_0x555fxf[_0x9daa[106]][_0x9daa[109]]]})[_0x9daa[31]](createImportFields(_0x555fx2e))})[_0x9daa[20]](function(){return _0x555fx10[_0x9daa[19]](201)[_0x9daa[18]](_0x555fx16)})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x555fx12);return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[111]]= function(_0x555fxf,_0x555fx10,_0x555fx11){if(_0x555fxf[_0x9daa[106]][_0x9daa[47]]){delete _0x555fxf[_0x9daa[106]][_0x9daa[47]]};var _0x555fx16;return sequelize[_0x9daa[108]](function(_0x555fx2e){return CustomReport[_0x9daa[49]](_0x555fxf[_0x9daa[48]][_0x9daa[47]])[_0x9daa[20]](function(_0x555fx18){if(!_0x555fx18){return _0x555fx10[_0x9daa[35]](404)};var _0x555fx30=_[_0x9daa[112]](_0x555fx18,_0x555fxf[_0x9daa[106]]);return _0x555fx18[_0x9daa[113]]({transaction:_0x555fx2e})})[_0x9daa[20]](function(_0x555fx18){_0x555fx16= _0x555fx18;if(_0x555fxf[_0x9daa[106]][_0x9daa[109]]){return ReportField[_0x9daa[74]]({where:{CustomReportId:_0x555fxf[_0x9daa[48]][_0x9daa[47]]},transaction:_0x555fx2e})}})[_0x9daa[20]](function(){return [_0x555fx16,_0x555fxf[_0x9daa[106]][_0x9daa[109]]]})[_0x9daa[31]](createFields(_0x555fx2e))})[_0x9daa[20]](function(){return _0x555fx10[_0x9daa[35]](200)})[_0x9daa[17]](function(_0x555fx12){console[_0x9daa[26]](_0x555fx12);return handleError(_0x555fx10,_0x555fx12)})};function createFields(_0x555fx2e){return function(_0x555fx18,_0x555fx32){if(_0x555fx32&& Array[_0x9daa[53]](_0x555fx32)&& _0x555fx32[_0x9daa[54]]){var _0x555fx33=reportBuildUtils[_0x9daa[114]](_0x555fx18[_0x9daa[42]]);if(_0x555fx33){var _0x555fx34;return _0x555fx33[_0x9daa[127]]()[_0x9daa[20]](function(_0x555fx39){_0x555fx34= _[_0x9daa[125]](_0x555fx39);return Metric[_0x9daa[126]]()})[_0x9daa[20]](function(_0x555fx35){var _0x555fx36=[];_0x555fx35= _[_0x9daa[107]](_0x555fx35,_0x9daa[43]);_0x555fx32[_0x9daa[62]](function(_0x555fx37){_0x555fx37[_0x9daa[115]]= _0x555fx18[_0x9daa[47]];if(_0x555fx37[_0x9daa[116]]){var _0x555fx38=_[_0x9daa[72]](_0x555fx35,{id:_0x555fx37[_0x9daa[116]]});if(_0x555fx38){_0x555fx37[_0x9daa[117]]= _0x555fx38[_0x9daa[118]];_0x555fx36[_0x9daa[75]](ReportField[_0x9daa[94]](_0x555fx37,{transaction:_0x555fx2e}))}else {throw  new sequelize.Error(_0x9daa[119]+ _0x555fx37[_0x9daa[116]]+ _0x9daa[120])}}else {if(_[_0x9daa[121]](_0x555fx34,_0x555fx37[_0x9daa[117]])|| _0x555fx37[_0x9daa[122]]){_0x555fx36[_0x9daa[75]](ReportField[_0x9daa[94]](_0x555fx37,{transaction:_0x555fx2e}))}else {throw  new sequelize.Error(_0x9daa[123]+ _0x555fx37[_0x9daa[117]]+ _0x9daa[124])}}});return _0x555fx36})[_0x9daa[29]]()}else {throw  new sequelize.Error(_0x9daa[128])}}}}function createImportFields(_0x555fx2e){return function(_0x555fx18,_0x555fx32){if(_0x555fx32&& Array[_0x9daa[53]](_0x555fx32)&& _0x555fx32[_0x9daa[54]]){var _0x555fx33=reportBuildUtils[_0x9daa[114]](_0x555fx18[_0x9daa[42]]);if(_0x555fx33){var _0x555fx34;return _0x555fx33[_0x9daa[127]]()[_0x9daa[20]](function(_0x555fx39){_0x555fx34= _[_0x9daa[125]](_0x555fx39);var _0x555fx36=[];var _0x555fx3b;if(_[_0x9daa[131]](_0x555fx32,function(_0x555fx37){return _[_0x9daa[130]](_0x555fx37,_0x9daa[129])})){_0x555fx3b= _0x9daa[132]}else {if(_[_0x9daa[131]](_0x555fx32,function(_0x555fx37){return _[_0x9daa[130]](_0x555fx37,_0x9daa[116])})){_0x555fx3b= _0x9daa[7]}else {throw  new sequelize.Error(_0x9daa[133])}};var _0x555fx3c=_[_0x9daa[135]](_0x555fx32,_0x555fx3b+ _0x9daa[134]);_[_0x9daa[61]](_0x555fx3c,function(_0x555fx3d,_0x555fx1d){if(_0x555fx1d!== _0x9daa[136]&& _0x555fx1d!== _0x9daa[137]){_0x555fx3d[0][_0x555fx3b][_0x9daa[138]][_0x9daa[62]](function(_0x555fx37){_0x555fx37[_0x9daa[115]]= _0x555fx18[_0x9daa[47]]});_0x555fx3d[0][_0x555fx3b][_0x9daa[88]]+= _0x9daa[139]+ sr({length:5});_0x555fx36[_0x9daa[75]](Metric[_0x9daa[94]](_0x555fx3d[0][_0x555fx3b],{include:[{model:ReportField,as:_0x9daa[138]}],transaction:_0x555fx2e}))}else {_0x555fx3d[_0x9daa[62]](function(_0x555fx37){if(_[_0x9daa[121]](_0x555fx34,_0x555fx37[_0x9daa[117]])|| _0x555fx37[_0x9daa[122]]){_0x555fx37[_0x9daa[115]]= _0x555fx18[_0x9daa[47]];_0x555fx36[_0x9daa[75]](ReportField[_0x9daa[94]](_0x555fx37,{transaction:_0x555fx2e}))}else {throw  new sequelize.Error(_0x9daa[123]+ _0x555fx37[_0x9daa[117]]+ _0x9daa[124])}})}});return _0x555fx36})[_0x9daa[29]]()}else {throw  new sequelize.Error(_0x9daa[128])}}}}exports[_0x9daa[74]]= function(_0x555fxf,_0x555fx10){return CustomReport[_0x9daa[49]](_0x555fxf[_0x9daa[48]][_0x9daa[47]])[_0x9daa[20]](function(_0x555fx18){if(!_0x555fx18){return _0x555fx10[_0x9daa[35]](404)};return _0x555fx18[_0x9daa[74]]()})[_0x9daa[20]](function(){return _0x555fx10[_0x9daa[35]](204)})[_0x9daa[17]](function(_0x555fx12){return handleError(_0x555fx10,_0x555fx12)})};exports[_0x9daa[140]]= function(_0x555fxf,_0x555fx10){return CustomReport[_0x9daa[74]]({where:{id:_0x555fxf[_0x9daa[21]][_0x9daa[141]]},individualHooks:true})[_0x9daa[20]](function(){return _0x555fx10[_0x9daa[35]](204)})[_0x9daa[17]](function(_0x555fx12){return handleError(_0x555fx10,_0x555fx12)})};function handleError(_0x555fx10,_0x555fx12){return _0x555fx10[_0x9daa[19]](500)[_0x9daa[18]](_0x555fx12)}
\ No newline at end of file
+var _0x138a=["\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"];_0x138a[0];var _=require(_0x138a[1]);var util=require(_0x138a[2]);var sequelize=require(_0x138a[4])[_0x138a[3]];var CustomReport=require(_0x138a[4])[_0x138a[5]];var ReportField=require(_0x138a[4])[_0x138a[6]];var Metric=require(_0x138a[4])[_0x138a[7]];var ExtractedReport=require(_0x138a[4])[_0x138a[8]];var extractUtils=require(_0x138a[9]);var reportBuildUtils=require(_0x138a[10]);var Util=require(_0x138a[11]);var sr=require(_0x138a[12]);var moment=require(_0x138a[13]);var cp=require(_0x138a[14]);var ReportTree=require(_0x138a[4])[_0x138a[15]];exports[_0x138a[16]]= function(_0x7426xf,_0x7426x10,_0x7426x11){return CustomReport[_0x138a[23]](Util[_0x138a[22]](_0x7426xf[_0x138a[21]],{deletedAt:null}))[_0x138a[20]](function(_0x7426x13){_0x7426x10[_0x138a[19]](200)[_0x138a[18]](_0x7426x13)})[_0x138a[17]](function(_0x7426x12){return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[24]]= function(_0x7426xf,_0x7426x10){return Promise[_0x138a[29]]([])[_0x138a[20]](getQuery(_0x7426xf,_0x7426x10))[_0x138a[20]](function(_0x7426x14){if(_0x7426x14){switch(_0x7426x14){case _0x138a[28]:_0x7426x14= _0x138a[27];break;default:}};_0x7426x10[_0x138a[19]](200)[_0x138a[18]]({query:_0x7426x14})})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x138a[25],_0x7426x12)})};function getQuery(_0x7426xf,_0x7426x10){var _0x7426x16;return function(){return CustomReport[_0x138a[51]](_0x138a[50])[_0x138a[49]](_0x7426xf[_0x138a[48]][_0x138a[47]])[_0x138a[20]](function(_0x7426x18){console[_0x138a[26]](_0x138a[34]);if(!_0x7426x18){return _0x7426x10[_0x138a[35]](404)};if(_0x7426xf[_0x138a[21]][_0x138a[36]]&& _0x7426xf[_0x138a[21]][_0x138a[36]]=== _0x138a[37]){_0x7426xf[_0x138a[21]][_0x138a[38]]= moment()[_0x138a[40]](_0x138a[39]);_0x7426xf[_0x138a[21]][_0x138a[41]]= moment()[_0x138a[40]](_0x138a[39]);_0x7426x18[_0x138a[43]][_0x138a[42]]= _0x7426x18[_0x138a[43]][_0x138a[42]][_0x138a[46]](_0x138a[44],_0x138a[45])};delete _0x7426xf[_0x138a[21]][_0x138a[36]];_0x7426x16= _0x7426x18[_0x138a[43]];return _0x7426x16[_0x138a[42]]})[_0x138a[20]](reportBuildUtils[_0x138a[33]](_0x7426xf[_0x138a[32]]))[_0x138a[20]](function(_0x7426x17){return [_0x7426x17,_0x7426x16]})[_0x138a[31]](reportBuildUtils[_0x138a[30]](_0x7426xf[_0x138a[21]]))}}exports[_0x138a[52]]= function(_0x7426xf,_0x7426x10){var _0x7426x19;return Promise[_0x138a[29]]([])[_0x138a[20]](getQuery(_0x7426xf,_0x7426x10))[_0x138a[20]](reportBuildUtils[_0x138a[64]]())[_0x138a[20]](function(_0x7426x1a){if(_0x7426x1a&& _[_0x138a[53]](_0x7426x1a)){_0x7426x19= _0x7426x1a[_0x138a[54]];if(_0x7426xf[_0x138a[21]][_0x138a[55]]){_0x7426x1a= _(_0x7426x1a)[_0x138a[59]](_0x7426xf[_0x138a[21]][_0x138a[58]]|| 0)[_0x138a[57]](_0x7426xf[_0x138a[21]][_0x138a[55]])[_0x138a[56]]()};_[_0x138a[62]](_0x7426x1a,function(_0x7426x1b){_[_0x138a[61]](_0x7426x1b,function(_0x7426x1c,_0x7426x1d){if(_0x7426x1c instanceof  Date){_0x7426x1b[_0x7426x1d]= moment(_0x7426x1c)[_0x138a[40]](_0x138a[60]).toString()}})});_0x7426x10[_0x138a[19]](200)[_0x138a[18]]({rows:_0x7426x1a,count:_0x7426x19})}else {return handleError(_0x7426x10,{message:_0x7426x1a|| _0x138a[63]})}})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x7426x12);return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[65]]= function(_0x7426xf,_0x7426x10){docExtract(_0x7426xf,_0x7426x10,_0x138a[66])};exports[_0x138a[67]]= function(_0x7426xf,_0x7426x10){docExtract(_0x7426xf,_0x7426x10,_0x138a[68])};exports[_0x138a[69]]= function(_0x7426xf,_0x7426x10){return ReportTree[_0x138a[49]](2)[_0x138a[20]](function(_0x7426x1e){_0x7426x1e= JSON[_0x138a[71]](_0x7426x1e[_0x138a[70]]);var _0x7426x1f=_[_0x138a[72]](_0x7426x1e,{id:_0x7426xf[_0x138a[48]][_0x138a[47]]});if(!_0x7426x1f){throw  new Error(_0x138a[73])};var _0x7426x20=[];findSubNodes(_0x7426x1f,_0x7426x1e,_0x7426x20);return CustomReport[_0x138a[74]]({where:{parent:_0x7426x20},individualHooks:true})})[_0x138a[20]](function(){return _0x7426x10[_0x138a[35]](200)})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x7426x12);return handleError(_0x7426x10,_0x7426x12)})};function findSubNodes(_0x7426x1f,_0x7426x1e,_0x7426x22){_0x7426x22[_0x138a[75]](_0x7426x1f[_0x138a[47]]);var _0x7426x23=_[_0x138a[76]](_0x7426x1e,{parent:_0x7426x1f[_0x138a[47]]});if(!_0x7426x23|| !_0x7426x23[_0x138a[54]]){return};_[_0x138a[62]](_0x7426x23,function(_0x7426x24){findSubNodes(_0x7426x24,_0x7426x1e,_0x7426x22)})}function docExtract(_0x7426xf,_0x7426x10,_0x7426x26){var _0x7426x18;CustomReport[_0x138a[51]](_0x138a[50])[_0x138a[49]](_0x7426xf[_0x138a[48]][_0x138a[47]])[_0x138a[20]](function(_0x7426x16){if(!_0x7426x16){return _0x7426x10[_0x138a[35]](404)};_0x7426x18= _0x7426x16;return ReportTree[_0x138a[49]](2)})[_0x138a[20]](function(_0x7426x1e){_0x7426x1e= JSON[_0x138a[71]](_0x7426x1e[_0x138a[70]]);var _0x7426x2a=_[_0x138a[72]](_0x7426x1e,{id:_0x7426x18[_0x138a[87]]});var _0x7426x2b=getReportPath(_0x7426x2a,_0x7426x1e,_0x7426x18[_0x138a[88]]);if(_0x7426xf[_0x138a[21]][_0x138a[36]]&& _0x7426xf[_0x138a[21]][_0x138a[36]]=== _0x138a[37]){_0x7426xf[_0x138a[21]][_0x138a[38]]= moment()[_0x138a[40]](_0x138a[39]);_0x7426xf[_0x138a[21]][_0x138a[41]]= moment()[_0x138a[40]](_0x138a[39]);_0x7426x18[_0x138a[43]][_0x138a[42]]= _0x7426x18[_0x138a[43]][_0x138a[42]][_0x138a[46]](_0x138a[44],_0x138a[45])};delete _0x7426xf[_0x138a[21]][_0x138a[36]];return [_0x7426x18,ExtractedReport[_0x138a[94]]({name:_0x7426x2b,startDate:_0x7426xf[_0x138a[21]][_0x138a[38]]?_0x7426xf[_0x138a[21]][_0x138a[38]]+ (_0x7426xf[_0x138a[21]][_0x138a[89]]?_0x138a[90]+ _0x7426xf[_0x138a[21]][_0x138a[89]]:_0x138a[91]):null,endDate:_0x7426xf[_0x138a[21]][_0x138a[41]]?_0x7426xf[_0x138a[21]][_0x138a[41]]+ (_0x7426xf[_0x138a[21]][_0x138a[92]]?_0x138a[90]+ _0x7426xf[_0x138a[21]][_0x138a[92]]:_0x138a[93]):null,output:_0x7426x26,UserId:_0x7426xf[_0x138a[32]][_0x138a[47]]})]})[_0x138a[31]](function(_0x7426x18,_0x7426x27){var _0x7426x28=cp[_0x138a[78]](__dirname+ _0x138a[77]);_0x7426x28[_0x138a[81]](_0x138a[84],function(_0x7426x29){console[_0x138a[26]](_0x138a[85],_0x7426x29);_0x7426x28[_0x138a[86]]()})[_0x138a[81]](_0x138a[82],function(){console[_0x138a[26]](_0x138a[83])})[_0x138a[81]](_0x138a[79],function(_0x7426x12){console[_0x138a[26]](_0x138a[80],_0x7426x12)});_0x7426x28[_0x138a[18]]({report:_0x7426x18,query:_0x7426xf[_0x138a[21]],extractedId:_0x7426x27[_0x138a[47]],user:_0x7426xf[_0x138a[32]],type:_0x7426x26})})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x7426x12);return handleError(_0x7426x10,_0x7426x12)});return _0x7426x10[_0x138a[35]](200)}function getReportPath(_0x7426x2a,_0x7426x1e,_0x7426x2b){_0x7426x2b= _0x7426x2a[_0x138a[95]]+ _0x138a[96]+ _0x7426x2b;if(_0x7426x2a[_0x138a[87]]=== _0x138a[97]){return _0x7426x2b}else {return getReportPath(_[_0x138a[72]](_0x7426x1e,{id:_0x7426x2a[_0x138a[87]]}),_0x7426x1e,_0x7426x2b)}}exports[_0x138a[98]]= function(_0x7426xf,_0x7426x10){return CustomReport[_0x138a[51]](_0x138a[50])[_0x138a[49]](_0x7426xf[_0x138a[48]][_0x138a[47]])[_0x138a[20]](function(_0x7426x18){if(!_0x7426x18){return _0x7426x10[_0x138a[35]](404)};return _0x7426x10[_0x138a[18]](_0x7426x18)})[_0x138a[17]](function(_0x7426x12){return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[99]]= function(_0x7426xf,_0x7426x10){return CustomReport[_0x138a[51]]({method:[_0x138a[102],{CustomReportId:_0x7426xf[_0x138a[48]][_0x138a[47]]}]})[_0x138a[49]](_0x7426xf[_0x138a[48]][_0x138a[47]],{attributes:[_0x138a[100],_0x138a[101],_0x138a[88],_0x138a[87],_0x138a[42]]})[_0x138a[20]](function(_0x7426x18){if(!_0x7426x18){return _0x7426x10[_0x138a[35]](404)};return _0x7426x10[_0x138a[18]](_0x7426x18)})[_0x138a[17]](function(_0x7426x12){return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[103]]= function(_0x7426xf,_0x7426x10){var _0x7426x2d;return sequelize[_0x138a[108]](function(_0x7426x2e){return CustomReport[_0x138a[51]](_0x138a[50])[_0x138a[49]](_0x7426xf[_0x138a[48]][_0x138a[47]])[_0x138a[20]](function(_0x7426x18){if(!_0x7426x18){return _0x7426x10[_0x138a[35]](404)};var _0x7426x2f=_0x7426x18[_0x138a[43]];delete _0x7426x2f[_0x138a[47]];delete _0x7426x2f[_0x138a[104]];delete _0x7426x2f[_0x138a[105]];_0x7426x2f[_0x138a[87]]= _0x7426xf[_0x138a[106]][_0x138a[87]];_0x7426x2d= _[_0x138a[107]](_0x7426x2f.Fields,_0x138a[43]);return CustomReport[_0x138a[94]](_0x7426x2f,{transaction:_0x7426x2e})})[_0x138a[20]](function(_0x7426x18){return [_0x7426x18,_0x7426x2d]})[_0x138a[31]](createFields(_0x7426x2e))})[_0x138a[20]](function(){return _0x7426x10[_0x138a[35]](201)})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x7426x12);return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[94]]= function(_0x7426xf,_0x7426x10){var _0x7426x16;return sequelize[_0x138a[108]](function(_0x7426x2e){return CustomReport[_0x138a[94]](_0x7426xf[_0x138a[106]],{transaction:_0x7426x2e})[_0x138a[20]](function(_0x7426x18){_0x7426x16= _0x7426x18;return [_0x7426x16,_0x7426xf[_0x138a[106]][_0x138a[109]]]})[_0x138a[31]](createFields(_0x7426x2e))})[_0x138a[20]](function(){return _0x7426x10[_0x138a[19]](201)[_0x138a[18]](_0x7426x16)})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x7426x12);return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[110]]= function(_0x7426xf,_0x7426x10){var _0x7426x16;return sequelize[_0x138a[108]](function(_0x7426x2e){return CustomReport[_0x138a[94]](_0x7426xf[_0x138a[106]],{transaction:_0x7426x2e})[_0x138a[20]](function(_0x7426x18){_0x7426x16= _0x7426x18;return [_0x7426x16,_0x7426xf[_0x138a[106]][_0x138a[109]]]})[_0x138a[31]](createImportFields(_0x7426x2e))})[_0x138a[20]](function(){return _0x7426x10[_0x138a[19]](201)[_0x138a[18]](_0x7426x16)})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x7426x12);return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[111]]= function(_0x7426xf,_0x7426x10,_0x7426x11){if(_0x7426xf[_0x138a[106]][_0x138a[47]]){delete _0x7426xf[_0x138a[106]][_0x138a[47]]};var _0x7426x16;return sequelize[_0x138a[108]](function(_0x7426x2e){return CustomReport[_0x138a[49]](_0x7426xf[_0x138a[48]][_0x138a[47]])[_0x138a[20]](function(_0x7426x18){if(!_0x7426x18){return _0x7426x10[_0x138a[35]](404)};var _0x7426x30=_[_0x138a[112]](_0x7426x18,_0x7426xf[_0x138a[106]]);return _0x7426x18[_0x138a[113]]({transaction:_0x7426x2e})})[_0x138a[20]](function(_0x7426x18){_0x7426x16= _0x7426x18;if(_0x7426xf[_0x138a[106]][_0x138a[109]]){return ReportField[_0x138a[74]]({where:{CustomReportId:_0x7426xf[_0x138a[48]][_0x138a[47]]},transaction:_0x7426x2e})}})[_0x138a[20]](function(){return [_0x7426x16,_0x7426xf[_0x138a[106]][_0x138a[109]]]})[_0x138a[31]](createFields(_0x7426x2e))})[_0x138a[20]](function(){return _0x7426x10[_0x138a[35]](200)})[_0x138a[17]](function(_0x7426x12){console[_0x138a[26]](_0x7426x12);return handleError(_0x7426x10,_0x7426x12)})};function createFields(_0x7426x2e){return function(_0x7426x18,_0x7426x32){if(_0x7426x32&& Array[_0x138a[53]](_0x7426x32)&& _0x7426x32[_0x138a[54]]){var _0x7426x33=reportBuildUtils[_0x138a[114]](_0x7426x18[_0x138a[42]]);if(_0x7426x33){var _0x7426x34;return _0x7426x33[_0x138a[127]]()[_0x138a[20]](function(_0x7426x39){_0x7426x34= _[_0x138a[125]](_0x7426x39);return Metric[_0x138a[126]]()})[_0x138a[20]](function(_0x7426x35){var _0x7426x36=[];_0x7426x35= _[_0x138a[107]](_0x7426x35,_0x138a[43]);_0x7426x32[_0x138a[62]](function(_0x7426x37){_0x7426x37[_0x138a[115]]= _0x7426x18[_0x138a[47]];if(_0x7426x37[_0x138a[116]]){var _0x7426x38=_[_0x138a[72]](_0x7426x35,{id:_0x7426x37[_0x138a[116]]});if(_0x7426x38){_0x7426x37[_0x138a[117]]= _0x7426x38[_0x138a[118]];_0x7426x36[_0x138a[75]](ReportField[_0x138a[94]](_0x7426x37,{transaction:_0x7426x2e}))}else {throw  new sequelize.Error(_0x138a[119]+ _0x7426x37[_0x138a[116]]+ _0x138a[120])}}else {if(_[_0x138a[121]](_0x7426x34,_0x7426x37[_0x138a[117]])|| _0x7426x37[_0x138a[122]]){_0x7426x36[_0x138a[75]](ReportField[_0x138a[94]](_0x7426x37,{transaction:_0x7426x2e}))}else {throw  new sequelize.Error(_0x138a[123]+ _0x7426x37[_0x138a[117]]+ _0x138a[124])}}});return _0x7426x36})[_0x138a[29]]()}else {throw  new sequelize.Error(_0x138a[128])}}}}function createImportFields(_0x7426x2e){return function(_0x7426x18,_0x7426x32){if(_0x7426x32&& Array[_0x138a[53]](_0x7426x32)&& _0x7426x32[_0x138a[54]]){var _0x7426x33=reportBuildUtils[_0x138a[114]](_0x7426x18[_0x138a[42]]);if(_0x7426x33){var _0x7426x34;return _0x7426x33[_0x138a[127]]()[_0x138a[20]](function(_0x7426x39){_0x7426x34= _[_0x138a[125]](_0x7426x39);var _0x7426x36=[];var _0x7426x3b;if(_[_0x138a[131]](_0x7426x32,function(_0x7426x37){return _[_0x138a[130]](_0x7426x37,_0x138a[129])})){_0x7426x3b= _0x138a[132]}else {if(_[_0x138a[131]](_0x7426x32,function(_0x7426x37){return _[_0x138a[130]](_0x7426x37,_0x138a[116])})){_0x7426x3b= _0x138a[7]}else {throw  new sequelize.Error(_0x138a[133])}};var _0x7426x3c=_[_0x138a[135]](_0x7426x32,_0x7426x3b+ _0x138a[134]);_[_0x138a[61]](_0x7426x3c,function(_0x7426x3d,_0x7426x1d){if(_0x7426x1d!== _0x138a[136]&& _0x7426x1d!== _0x138a[137]){_0x7426x3d[0][_0x7426x3b][_0x138a[138]][_0x138a[62]](function(_0x7426x37){_0x7426x37[_0x138a[115]]= _0x7426x18[_0x138a[47]]});_0x7426x3d[0][_0x7426x3b][_0x138a[88]]+= _0x138a[139]+ sr({length:5});_0x7426x36[_0x138a[75]](Metric[_0x138a[94]](_0x7426x3d[0][_0x7426x3b],{include:[{model:ReportField,as:_0x138a[138]}],transaction:_0x7426x2e}))}else {_0x7426x3d[_0x138a[62]](function(_0x7426x37){if(_[_0x138a[121]](_0x7426x34,_0x7426x37[_0x138a[117]])|| _0x7426x37[_0x138a[122]]){_0x7426x37[_0x138a[115]]= _0x7426x18[_0x138a[47]];_0x7426x36[_0x138a[75]](ReportField[_0x138a[94]](_0x7426x37,{transaction:_0x7426x2e}))}else {throw  new sequelize.Error(_0x138a[123]+ _0x7426x37[_0x138a[117]]+ _0x138a[124])}})}});return _0x7426x36})[_0x138a[29]]()}else {throw  new sequelize.Error(_0x138a[128])}}}}exports[_0x138a[74]]= function(_0x7426xf,_0x7426x10){return CustomReport[_0x138a[49]](_0x7426xf[_0x138a[48]][_0x138a[47]])[_0x138a[20]](function(_0x7426x18){if(!_0x7426x18){return _0x7426x10[_0x138a[35]](404)};return _0x7426x18[_0x138a[74]]()})[_0x138a[20]](function(){return _0x7426x10[_0x138a[35]](204)})[_0x138a[17]](function(_0x7426x12){return handleError(_0x7426x10,_0x7426x12)})};exports[_0x138a[140]]= function(_0x7426xf,_0x7426x10){return CustomReport[_0x138a[74]]({where:{id:_0x7426xf[_0x138a[21]][_0x138a[141]]},individualHooks:true})[_0x138a[20]](function(){return _0x7426x10[_0x138a[35]](204)})[_0x138a[17]](function(_0x7426x12){return handleError(_0x7426x10,_0x7426x12)})};function handleError(_0x7426x10,_0x7426x12){return _0x7426x10[_0x138a[19]](500)[_0x138a[18]](_0x7426x12)}
\ No newline at end of file