Built motion from commit 683a3d1.|0.0.135
[motion.git] / server / api / custom_report / custom_report.controller.js
index 9f68192..58af2ab 100644 (file)
@@ -1 +1 @@
-var _0xabfc=["\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","\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","\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","\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","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\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","\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","\x6E\x61\x6D\x65","\x63\x72\x65\x61\x74\x65","\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","\x70\x61\x72\x65\x6E\x74","\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","\x64\x65\x73\x74\x72\x6F\x79","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x69\x73\x41\x72\x72\x61\x79","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x4D\x65\x74\x72\x69\x63\x49\x64","\x66\x69\x6E\x64","\x66\x69\x65\x6C\x64","\x6D\x65\x74\x72\x69\x63","\x70\x75\x73\x68","\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","\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","\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","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x73\x65\x73\x73\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x63\x68\x61\x74\x5F\x73\x65\x73\x73\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x65\x6D\x62\x65\x72\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x53\x6D\x73\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x72\x65\x70\x6F\x72\x74\x5F\x73\x6D\x73\x5F\x73\x65\x73\x73\x69\x6F\x6E\x5F\x68\x69\x73\x74\x6F\x72\x79","\x43\x6F\x6E\x74\x61\x63\x74","\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73","\x56\x6F\x69\x63\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67","\x76\x6F\x69\x63\x65\x5F\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x73","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xabfc[0];var _=require(_0xabfc[1]);var util=require(_0xabfc[2]);var sequelize=require(_0xabfc[4])[_0xabfc[3]];var CustomReport=require(_0xabfc[4])[_0xabfc[5]];var ReportField=require(_0xabfc[4])[_0xabfc[6]];var Metric=require(_0xabfc[4])[_0xabfc[7]];var ExtractedReport=require(_0xabfc[4])[_0xabfc[8]];var extractUtils=require(_0xabfc[9]);var reportBuildUtils=require(_0xabfc[10]);var Util=require(_0xabfc[11]);var sr=require(_0xabfc[12]);var moment=require(_0xabfc[13]);var cp=require(_0xabfc[14]);exports[_0xabfc[15]]=function(_0xea34xe,_0xea34xf,_0xea34x10){return CustomReport[_0xabfc[22]](Util[_0xabfc[21]](_0xea34xe[_0xabfc[20]]))[_0xabfc[19]](function(_0xea34x12){_0xea34xf[_0xabfc[18]](200)[_0xabfc[17]](_0xea34x12)})[_0xabfc[16]](function(_0xea34x11){return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[23]]=function(_0xea34xe,_0xea34xf){return Promise[_0xabfc[26]]([])[_0xabfc[19]](getQuery(_0xea34xe,_0xea34xf))[_0xabfc[19]](function(_0xea34x13){_0xea34xf[_0xabfc[18]](200)[_0xabfc[17]]({query:_0xea34x13})})[_0xabfc[16]](function(_0xea34x11){console[_0xabfc[25]](_0xabfc[24],_0xea34x11)})};function getQuery(_0xea34xe,_0xea34xf){var _0xea34x15;return function(){return CustomReport[_0xabfc[48]](_0xabfc[47])[_0xabfc[46]](_0xea34xe[_0xabfc[45]][_0xabfc[44]])[_0xabfc[19]](function(_0xea34x17){console[_0xabfc[25]](_0xabfc[31]);if(!_0xea34x17){return _0xea34xf[_0xabfc[32]](404)};if(_0xea34xe[_0xabfc[20]][_0xabfc[33]]&&_0xea34xe[_0xabfc[20]][_0xabfc[33]]===_0xabfc[34]){_0xea34xe[_0xabfc[20]][_0xabfc[35]]=moment()[_0xabfc[37]](_0xabfc[36]);_0xea34xe[_0xabfc[20]][_0xabfc[38]]=moment()[_0xabfc[37]](_0xabfc[36]);_0xea34x17[_0xabfc[40]][_0xabfc[39]]=_0xea34x17[_0xabfc[40]][_0xabfc[39]][_0xabfc[43]](_0xabfc[41],_0xabfc[42])};delete _0xea34xe[_0xabfc[20]][_0xabfc[33]];_0xea34x15=_0xea34x17[_0xabfc[40]];return _0xea34x15[_0xabfc[39]]})[_0xabfc[19]](reportBuildUtils[_0xabfc[30]](_0xea34xe[_0xabfc[29]]))[_0xabfc[19]](function(_0xea34x16){return [_0xea34x16,_0xea34x15]})[_0xabfc[28]](reportBuildUtils[_0xabfc[27]](_0xea34xe[_0xabfc[20]]))}}exports[_0xabfc[49]]=function(_0xea34xe,_0xea34xf){var _0xea34x18;return Promise[_0xabfc[26]]([])[_0xabfc[19]](getQuery(_0xea34xe,_0xea34xf))[_0xabfc[19]](function(_0xea34x13){return _0xea34x13?sequelize[_0xabfc[20]](_0xea34x13,{type:sequelize[_0xabfc[60]][_0xabfc[59]]}):[]})[_0xabfc[19]](function(_0xea34x19){_0xea34x18=_0xea34x19[_0xabfc[50]];if(_0xea34xe[_0xabfc[20]][_0xabfc[51]]){_0xea34x19=_(_0xea34x19)[_0xabfc[55]](_0xea34xe[_0xabfc[20]][_0xabfc[54]]||0)[_0xabfc[53]](_0xea34xe[_0xabfc[20]][_0xabfc[51]])[_0xabfc[52]]()};_[_0xabfc[58]](_0xea34x19,function(_0xea34x1a){_[_0xabfc[57]](_0xea34x1a,function(_0xea34x1b,_0xea34x1c){if(_0xea34x1b instanceof Date){_0xea34x1a[_0xea34x1c]=moment(_0xea34x1b)[_0xabfc[37]](_0xabfc[56]).toString()}})});_0xea34xf[_0xabfc[18]](200)[_0xabfc[17]]({rows:_0xea34x19,count:_0xea34x18})})[_0xabfc[16]](function(_0xea34x11){console[_0xabfc[25]](_0xea34x11);return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[61]]=function(_0xea34xe,_0xea34xf){docExtract(_0xea34xe,_0xea34xf,_0xabfc[62])};exports[_0xabfc[63]]=function(_0xea34xe,_0xea34xf){docExtract(_0xea34xe,_0xea34xf,_0xabfc[64])};function docExtract(_0xea34xe,_0xea34xf,_0xea34x1e){CustomReport[_0xabfc[48]](_0xabfc[47])[_0xabfc[46]](_0xea34xe[_0xabfc[45]][_0xabfc[44]])[_0xabfc[19]](function(_0xea34x17){if(!_0xea34x17){return _0xea34xf[_0xabfc[32]](404)};if(_0xea34xe[_0xabfc[20]][_0xabfc[33]]&&_0xea34xe[_0xabfc[20]][_0xabfc[33]]===_0xabfc[34]){_0xea34xe[_0xabfc[20]][_0xabfc[35]]=moment()[_0xabfc[37]](_0xabfc[36]);_0xea34xe[_0xabfc[20]][_0xabfc[38]]=moment()[_0xabfc[37]](_0xabfc[36]);_0xea34x17[_0xabfc[40]][_0xabfc[39]]=_0xea34x17[_0xabfc[40]][_0xabfc[39]][_0xabfc[43]](_0xabfc[41],_0xabfc[42])};delete _0xea34xe[_0xabfc[20]][_0xabfc[33]];return [_0xea34x17,ExtractedReport[_0xabfc[76]]({name:_0xea34x17[_0xabfc[75]],startDate:_0xea34xe[_0xabfc[20]][_0xabfc[35]]||null,endDate:_0xea34xe[_0xabfc[20]][_0xabfc[38]]||null,output:_0xea34x1e,UserId:_0xea34xe[_0xabfc[29]][_0xabfc[44]]})]})[_0xabfc[28]](function(_0xea34x17,_0xea34x1f){var _0xea34x20=cp[_0xabfc[66]](__dirname+_0xabfc[65]);_0xea34x20[_0xabfc[69]](_0xabfc[72],function(_0xea34x21){console[_0xabfc[25]](_0xabfc[73],_0xea34x21);_0xea34x20[_0xabfc[74]]()})[_0xabfc[69]](_0xabfc[70],function(){console[_0xabfc[25]](_0xabfc[71])})[_0xabfc[69]](_0xabfc[67],function(_0xea34x11){console[_0xabfc[25]](_0xabfc[68],_0xea34x11)});_0xea34x20[_0xabfc[17]]({report:_0xea34x17,query:_0xea34xe[_0xabfc[20]],extractedId:_0xea34x1f[_0xabfc[44]],user:_0xea34xe[_0xabfc[29]],type:_0xea34x1e})})[_0xabfc[16]](function(_0xea34x11){console[_0xabfc[25]](_0xea34x11);return handleError(_0xea34xf,_0xea34x11)});return _0xea34xf[_0xabfc[32]](200)}exports[_0xabfc[77]]=function(_0xea34xe,_0xea34xf){return CustomReport[_0xabfc[48]](_0xabfc[47])[_0xabfc[46]](_0xea34xe[_0xabfc[45]][_0xabfc[44]])[_0xabfc[19]](function(_0xea34x17){if(!_0xea34x17){return _0xea34xf[_0xabfc[32]](404)};return _0xea34xf[_0xabfc[17]](_0xea34x17)})[_0xabfc[16]](function(_0xea34x11){return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[78]]=function(_0xea34xe,_0xea34xf){return CustomReport[_0xabfc[48]]({method:[_0xabfc[82],{CustomReportId:_0xea34xe[_0xabfc[45]][_0xabfc[44]]}]})[_0xabfc[46]](_0xea34xe[_0xabfc[45]][_0xabfc[44]],{attributes:[_0xabfc[79],_0xabfc[80],_0xabfc[75],_0xabfc[81],_0xabfc[39]]})[_0xabfc[19]](function(_0xea34x17){if(!_0xea34x17){return _0xea34xf[_0xabfc[32]](404)};return _0xea34xf[_0xabfc[17]](_0xea34x17)})[_0xabfc[16]](function(_0xea34x11){return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[83]]=function(_0xea34xe,_0xea34xf){var _0xea34x22;return sequelize[_0xabfc[88]](function(_0xea34x23){return CustomReport[_0xabfc[48]](_0xabfc[47])[_0xabfc[46]](_0xea34xe[_0xabfc[45]][_0xabfc[44]])[_0xabfc[19]](function(_0xea34x17){if(!_0xea34x17){return _0xea34xf[_0xabfc[32]](404)};var _0xea34x24=_0xea34x17[_0xabfc[40]];delete _0xea34x24[_0xabfc[44]];delete _0xea34x24[_0xabfc[84]];delete _0xea34x24[_0xabfc[85]];_0xea34x24[_0xabfc[81]]=_0xea34xe[_0xabfc[86]][_0xabfc[81]];_0xea34x22=_[_0xabfc[87]](_0xea34x24.Fields,_0xabfc[40]);return CustomReport[_0xabfc[76]](_0xea34x24,{transaction:_0xea34x23})})[_0xabfc[19]](function(_0xea34x17){return [_0xea34x17,_0xea34x22]})[_0xabfc[28]](createFields(_0xea34x23))})[_0xabfc[19]](function(){return _0xea34xf[_0xabfc[32]](201)})[_0xabfc[16]](function(_0xea34x11){console[_0xabfc[25]](_0xea34x11);return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[76]]=function(_0xea34xe,_0xea34xf){var _0xea34x15;return sequelize[_0xabfc[88]](function(_0xea34x23){return CustomReport[_0xabfc[76]](_0xea34xe[_0xabfc[86]],{transaction:_0xea34x23})[_0xabfc[19]](function(_0xea34x17){_0xea34x15=_0xea34x17;return [_0xea34x15,_0xea34xe[_0xabfc[86]][_0xabfc[89]]]})[_0xabfc[28]](createFields(_0xea34x23))})[_0xabfc[19]](function(){return _0xea34xf[_0xabfc[18]](201)[_0xabfc[17]](_0xea34x15)})[_0xabfc[16]](function(_0xea34x11){console[_0xabfc[25]](_0xea34x11);return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[90]]=function(_0xea34xe,_0xea34xf){var _0xea34x15;return sequelize[_0xabfc[88]](function(_0xea34x23){return CustomReport[_0xabfc[76]](_0xea34xe[_0xabfc[86]],{transaction:_0xea34x23})[_0xabfc[19]](function(_0xea34x17){_0xea34x15=_0xea34x17;return [_0xea34x15,_0xea34xe[_0xabfc[86]][_0xabfc[89]]]})[_0xabfc[28]](createImportFields(_0xea34x23))})[_0xabfc[19]](function(){return _0xea34xf[_0xabfc[18]](201)[_0xabfc[17]](_0xea34x15)})[_0xabfc[16]](function(_0xea34x11){console[_0xabfc[25]](_0xea34x11);return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[91]]=function(_0xea34xe,_0xea34xf,_0xea34x10){if(_0xea34xe[_0xabfc[86]][_0xabfc[44]]){delete _0xea34xe[_0xabfc[86]][_0xabfc[44]]};var _0xea34x15;return sequelize[_0xabfc[88]](function(_0xea34x23){return CustomReport[_0xabfc[46]](_0xea34xe[_0xabfc[45]][_0xabfc[44]])[_0xabfc[19]](function(_0xea34x17){if(!_0xea34x17){return _0xea34xf[_0xabfc[32]](404)};var _0xea34x25=_[_0xabfc[93]](_0xea34x17,_0xea34xe[_0xabfc[86]]);return _0xea34x17[_0xabfc[94]]({transaction:_0xea34x23})})[_0xabfc[19]](function(_0xea34x17){_0xea34x15=_0xea34x17;if(_0xea34xe[_0xabfc[86]][_0xabfc[89]]){return ReportField[_0xabfc[92]]({where:{CustomReportId:_0xea34xe[_0xabfc[45]][_0xabfc[44]]},transaction:_0xea34x23})}})[_0xabfc[19]](function(){return [_0xea34x15,_0xea34xe[_0xabfc[86]][_0xabfc[89]]]})[_0xabfc[28]](createFields(_0xea34x23))})[_0xabfc[19]](function(){return _0xea34xf[_0xabfc[32]](200)})[_0xabfc[16]](function(_0xea34x11){console[_0xabfc[25]](_0xea34x11);return handleError(_0xea34xf,_0xea34x11)})};function createFields(_0xea34x23){return function(_0xea34x17,_0xea34x27){if(_0xea34x27&&Array[_0xabfc[95]](_0xea34x27)&&_0xea34x27[_0xabfc[50]]){var _0xea34x28=getTable(_0xea34x17[_0xabfc[39]]);if(_0xea34x28){var _0xea34x29;return _0xea34x28[_0xabfc[109]]()[_0xabfc[19]](function(_0xea34x2e){_0xea34x29=_[_0xabfc[107]](_0xea34x2e);return Metric[_0xabfc[108]]()})[_0xabfc[19]](function(_0xea34x2a){var _0xea34x2b=[];_0xea34x2a=_[_0xabfc[87]](_0xea34x2a,_0xabfc[40]);_0xea34x27[_0xabfc[58]](function(_0xea34x2c){_0xea34x2c[_0xabfc[96]]=_0xea34x17[_0xabfc[44]];if(_0xea34x2c[_0xabfc[97]]){var _0xea34x2d=_[_0xabfc[98]](_0xea34x2a,{id:_0xea34x2c[_0xabfc[97]]});if(_0xea34x2d){_0xea34x2c[_0xabfc[99]]=_0xea34x2d[_0xabfc[100]];_0xea34x2b[_0xabfc[101]](ReportField[_0xabfc[76]](_0xea34x2c,{transaction:_0xea34x23}))}else {throw  new sequelize.Error(_0xabfc[102]+_0xea34x2c[_0xabfc[97]]+_0xabfc[103])}}else {if(_[_0xabfc[104]](_0xea34x29,_0xea34x2c[_0xabfc[99]])){_0xea34x2b[_0xabfc[101]](ReportField[_0xabfc[76]](_0xea34x2c,{transaction:_0xea34x23}))}else {throw  new sequelize.Error(_0xabfc[105]+_0xea34x2c[_0xabfc[99]]+_0xabfc[106])}}});return _0xea34x2b})[_0xabfc[26]]()}else {throw  new sequelize.Error(_0xabfc[110])}}}}function createImportFields(_0xea34x23){return function(_0xea34x17,_0xea34x27){if(_0xea34x27&&Array[_0xabfc[95]](_0xea34x27)&&_0xea34x27[_0xabfc[50]]){var _0xea34x28=getTable(_0xea34x17[_0xabfc[39]]);if(_0xea34x28){var _0xea34x29;return _0xea34x28[_0xabfc[109]]()[_0xabfc[19]](function(_0xea34x2e){_0xea34x29=_[_0xabfc[107]](_0xea34x2e);return Metric[_0xabfc[108]]()})[_0xabfc[19]](function(_0xea34x2a){var _0xea34x2b=[];var _0xea34x30=_[_0xabfc[111]](_0xea34x27,_0xabfc[97]);_[_0xabfc[57]](_0xea34x30,function(_0xea34x31,_0xea34x1c){if(_0xea34x1c!==_0xabfc[112]&&_0xea34x1c!==_0xabfc[113]){_0xea34x31[0][_0xabfc[7]][_0xabfc[114]][_0xabfc[58]](function(_0xea34x2c){_0xea34x2c[_0xabfc[96]]=_0xea34x17[_0xabfc[44]]});_0xea34x31[0][_0xabfc[7]][_0xabfc[75]]+=_0xabfc[115]+sr({length:5});console[_0xabfc[25]](_0xabfc[100],_0xea34x31[0].Metric);_0xea34x2b[_0xabfc[101]](Metric[_0xabfc[76]](_0xea34x31[0].Metric,{include:[{model:ReportField,as:_0xabfc[114]}],transaction:_0xea34x23}))}else {_0xea34x31[_0xabfc[58]](function(_0xea34x2c){if(_[_0xabfc[104]](_0xea34x29,_0xea34x2c[_0xabfc[99]])){_0xea34x2c[_0xabfc[96]]=_0xea34x17[_0xabfc[44]];_0xea34x2b[_0xabfc[101]](ReportField[_0xabfc[76]](_0xea34x2c,{transaction:_0xea34x23}))}else {throw  new sequelize.Error(_0xabfc[105]+_0xea34x2c[_0xabfc[99]]+_0xabfc[106])}})}});return _0xea34x2b})[_0xabfc[26]]()}else {throw  new sequelize.Error(_0xabfc[110])}}}}function getTable(_0xea34x33){var _0xea34x28;switch(_0xea34x33){case _0xabfc[118]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[116]];break;case _0xabfc[120]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[119]];break;case _0xabfc[122]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[121]];break;case _0xabfc[124]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[123]];break;case _0xabfc[126]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[125]];break;case _0xabfc[128]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[127]];break;case _0xabfc[130]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[129]];break;case _0xabfc[132]:_0xea34x28=require(_0xabfc[4])[_0xabfc[117]][_0xabfc[131]];break;case _0xabfc[134]:_0xea34x28=require(_0xabfc[4])[_0xabfc[133]];break;case _0xabfc[136]:_0xea34x28=require(_0xabfc[4])[_0xabfc[135]];break;default:};return _0xea34x28}exports[_0xabfc[92]]=function(_0xea34xe,_0xea34xf){return CustomReport[_0xabfc[46]](_0xea34xe[_0xabfc[45]][_0xabfc[44]])[_0xabfc[19]](function(_0xea34x17){if(!_0xea34x17){return _0xea34xf[_0xabfc[32]](404)};return _0xea34x17[_0xabfc[92]]()})[_0xabfc[19]](function(){return _0xea34xf[_0xabfc[32]](204)})[_0xabfc[16]](function(_0xea34x11){return handleError(_0xea34xf,_0xea34x11)})};exports[_0xabfc[137]]=function(_0xea34xe,_0xea34xf){return CustomReport[_0xabfc[92]]({where:{id:_0xea34xe[_0xabfc[20]][_0xabfc[138]]},individualHooks:true})[_0xabfc[19]](function(){return _0xea34xf[_0xabfc[32]](204)})[_0xabfc[16]](function(_0xea34x11){return handleError(_0xea34xf,_0xea34x11)})};function handleError(_0xea34xf,_0xea34x11){return _0xea34xf[_0xabfc[18]](500)[_0xabfc[17]](_0xea34x11)}
\ No newline at end of file
+var _0x699f=["\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"];_0x699f[0];var _=require(_0x699f[1]);var util=require(_0x699f[2]);var sequelize=require(_0x699f[4])[_0x699f[3]];var CustomReport=require(_0x699f[4])[_0x699f[5]];var ReportField=require(_0x699f[4])[_0x699f[6]];var Metric=require(_0x699f[4])[_0x699f[7]];var ExtractedReport=require(_0x699f[4])[_0x699f[8]];var extractUtils=require(_0x699f[9]);var reportBuildUtils=require(_0x699f[10]);var Util=require(_0x699f[11]);var sr=require(_0x699f[12]);var moment=require(_0x699f[13]);var cp=require(_0x699f[14]);var ReportTree=require(_0x699f[4])[_0x699f[15]];exports[_0x699f[16]]= function(_0x742bxf,_0x742bx10,_0x742bx11){return CustomReport[_0x699f[23]](Util[_0x699f[22]](_0x742bxf[_0x699f[21]],{deletedAt:null}))[_0x699f[20]](function(_0x742bx13){_0x742bx10[_0x699f[19]](200)[_0x699f[18]](_0x742bx13)})[_0x699f[17]](function(_0x742bx12){return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[24]]= function(_0x742bxf,_0x742bx10){return Promise[_0x699f[29]]([])[_0x699f[20]](getQuery(_0x742bxf,_0x742bx10))[_0x699f[20]](function(_0x742bx14){if(_0x742bx14){switch(_0x742bx14){case _0x699f[28]:_0x742bx14= _0x699f[27];break;default:}};_0x742bx10[_0x699f[19]](200)[_0x699f[18]]({query:_0x742bx14})})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x699f[25],_0x742bx12)})};function getQuery(_0x742bxf,_0x742bx10){var _0x742bx16;return function(){return CustomReport[_0x699f[51]](_0x699f[50])[_0x699f[49]](_0x742bxf[_0x699f[48]][_0x699f[47]])[_0x699f[20]](function(_0x742bx18){console[_0x699f[26]](_0x699f[34]);if(!_0x742bx18){return _0x742bx10[_0x699f[35]](404)};if(_0x742bxf[_0x699f[21]][_0x699f[36]]&& _0x742bxf[_0x699f[21]][_0x699f[36]]=== _0x699f[37]){_0x742bxf[_0x699f[21]][_0x699f[38]]= moment()[_0x699f[40]](_0x699f[39]);_0x742bxf[_0x699f[21]][_0x699f[41]]= moment()[_0x699f[40]](_0x699f[39]);_0x742bx18[_0x699f[43]][_0x699f[42]]= _0x742bx18[_0x699f[43]][_0x699f[42]][_0x699f[46]](_0x699f[44],_0x699f[45])};delete _0x742bxf[_0x699f[21]][_0x699f[36]];_0x742bx16= _0x742bx18[_0x699f[43]];return _0x742bx16[_0x699f[42]]})[_0x699f[20]](reportBuildUtils[_0x699f[33]](_0x742bxf[_0x699f[32]]))[_0x699f[20]](function(_0x742bx17){return [_0x742bx17,_0x742bx16]})[_0x699f[31]](reportBuildUtils[_0x699f[30]](_0x742bxf[_0x699f[21]]))}}exports[_0x699f[52]]= function(_0x742bxf,_0x742bx10){var _0x742bx19;return Promise[_0x699f[29]]([])[_0x699f[20]](getQuery(_0x742bxf,_0x742bx10))[_0x699f[20]](reportBuildUtils[_0x699f[64]]())[_0x699f[20]](function(_0x742bx1a){if(_0x742bx1a&& _[_0x699f[53]](_0x742bx1a)){_0x742bx19= _0x742bx1a[_0x699f[54]];if(_0x742bxf[_0x699f[21]][_0x699f[55]]){_0x742bx1a= _(_0x742bx1a)[_0x699f[59]](_0x742bxf[_0x699f[21]][_0x699f[58]]|| 0)[_0x699f[57]](_0x742bxf[_0x699f[21]][_0x699f[55]])[_0x699f[56]]()};_[_0x699f[62]](_0x742bx1a,function(_0x742bx1b){_[_0x699f[61]](_0x742bx1b,function(_0x742bx1c,_0x742bx1d){if(_0x742bx1c instanceof  Date){_0x742bx1b[_0x742bx1d]= moment(_0x742bx1c)[_0x699f[40]](_0x699f[60]).toString()}})});_0x742bx10[_0x699f[19]](200)[_0x699f[18]]({rows:_0x742bx1a,count:_0x742bx19})}else {return handleError(_0x742bx10,{message:_0x742bx1a|| _0x699f[63]})}})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x742bx12);return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[65]]= function(_0x742bxf,_0x742bx10){docExtract(_0x742bxf,_0x742bx10,_0x699f[66])};exports[_0x699f[67]]= function(_0x742bxf,_0x742bx10){docExtract(_0x742bxf,_0x742bx10,_0x699f[68])};exports[_0x699f[69]]= function(_0x742bxf,_0x742bx10){return ReportTree[_0x699f[49]](2)[_0x699f[20]](function(_0x742bx1e){_0x742bx1e= JSON[_0x699f[71]](_0x742bx1e[_0x699f[70]]);var _0x742bx1f=_[_0x699f[72]](_0x742bx1e,{id:_0x742bxf[_0x699f[48]][_0x699f[47]]});if(!_0x742bx1f){throw  new Error(_0x699f[73])};var _0x742bx20=[];findSubNodes(_0x742bx1f,_0x742bx1e,_0x742bx20);console[_0x699f[26]](_0x742bx20);return CustomReport[_0x699f[74]]({where:{parent:_0x742bx20},individualHooks:true})})[_0x699f[20]](function(){return _0x742bx10[_0x699f[35]](200)})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x742bx12);return handleError(_0x742bx10,_0x742bx12)})};function findSubNodes(_0x742bx1f,_0x742bx1e,_0x742bx22){_0x742bx22[_0x699f[75]](_0x742bx1f[_0x699f[47]]);var _0x742bx23=_[_0x699f[76]](_0x742bx1e,{parent:_0x742bx1f[_0x699f[47]]});if(!_0x742bx23|| !_0x742bx23[_0x699f[54]]){return};_[_0x699f[62]](_0x742bx23,function(_0x742bx24){findSubNodes(_0x742bx24,_0x742bx1e,_0x742bx22)})}function docExtract(_0x742bxf,_0x742bx10,_0x742bx26){var _0x742bx18;CustomReport[_0x699f[51]](_0x699f[50])[_0x699f[49]](_0x742bxf[_0x699f[48]][_0x699f[47]])[_0x699f[20]](function(_0x742bx16){if(!_0x742bx16){return _0x742bx10[_0x699f[35]](404)};_0x742bx18= _0x742bx16;return ReportTree[_0x699f[49]](2)})[_0x699f[20]](function(_0x742bx1e){_0x742bx1e= JSON[_0x699f[71]](_0x742bx1e[_0x699f[70]]);var _0x742bx2a=_[_0x699f[72]](_0x742bx1e,{id:_0x742bx18[_0x699f[87]]});var _0x742bx2b=getReportPath(_0x742bx2a,_0x742bx1e,_0x742bx18[_0x699f[88]]);if(_0x742bxf[_0x699f[21]][_0x699f[36]]&& _0x742bxf[_0x699f[21]][_0x699f[36]]=== _0x699f[37]){_0x742bxf[_0x699f[21]][_0x699f[38]]= moment()[_0x699f[40]](_0x699f[39]);_0x742bxf[_0x699f[21]][_0x699f[41]]= moment()[_0x699f[40]](_0x699f[39]);_0x742bx18[_0x699f[43]][_0x699f[42]]= _0x742bx18[_0x699f[43]][_0x699f[42]][_0x699f[46]](_0x699f[44],_0x699f[45])};delete _0x742bxf[_0x699f[21]][_0x699f[36]];return [_0x742bx18,ExtractedReport[_0x699f[94]]({name:_0x742bx2b,startDate:_0x742bxf[_0x699f[21]][_0x699f[38]]?_0x742bxf[_0x699f[21]][_0x699f[38]]+ (_0x742bxf[_0x699f[21]][_0x699f[89]]?_0x699f[90]+ _0x742bxf[_0x699f[21]][_0x699f[89]]:_0x699f[91]):null,endDate:_0x742bxf[_0x699f[21]][_0x699f[41]]?_0x742bxf[_0x699f[21]][_0x699f[41]]+ (_0x742bxf[_0x699f[21]][_0x699f[92]]?_0x699f[90]+ _0x742bxf[_0x699f[21]][_0x699f[92]]:_0x699f[93]):null,output:_0x742bx26,UserId:_0x742bxf[_0x699f[32]][_0x699f[47]]})]})[_0x699f[31]](function(_0x742bx18,_0x742bx27){var _0x742bx28=cp[_0x699f[78]](__dirname+ _0x699f[77]);_0x742bx28[_0x699f[81]](_0x699f[84],function(_0x742bx29){console[_0x699f[26]](_0x699f[85],_0x742bx29);_0x742bx28[_0x699f[86]]()})[_0x699f[81]](_0x699f[82],function(){console[_0x699f[26]](_0x699f[83])})[_0x699f[81]](_0x699f[79],function(_0x742bx12){console[_0x699f[26]](_0x699f[80],_0x742bx12)});_0x742bx28[_0x699f[18]]({report:_0x742bx18,query:_0x742bxf[_0x699f[21]],extractedId:_0x742bx27[_0x699f[47]],user:_0x742bxf[_0x699f[32]],type:_0x742bx26})})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x742bx12);return handleError(_0x742bx10,_0x742bx12)});return _0x742bx10[_0x699f[35]](200)}function getReportPath(_0x742bx2a,_0x742bx1e,_0x742bx2b){_0x742bx2b= _0x742bx2a[_0x699f[95]]+ _0x699f[96]+ _0x742bx2b;if(_0x742bx2a[_0x699f[87]]=== _0x699f[97]){return _0x742bx2b}else {return getReportPath(_[_0x699f[72]](_0x742bx1e,{id:_0x742bx2a[_0x699f[87]]}),_0x742bx1e,_0x742bx2b)}}exports[_0x699f[98]]= function(_0x742bxf,_0x742bx10){return CustomReport[_0x699f[51]](_0x699f[50])[_0x699f[49]](_0x742bxf[_0x699f[48]][_0x699f[47]])[_0x699f[20]](function(_0x742bx18){if(!_0x742bx18){return _0x742bx10[_0x699f[35]](404)};return _0x742bx10[_0x699f[18]](_0x742bx18)})[_0x699f[17]](function(_0x742bx12){return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[99]]= function(_0x742bxf,_0x742bx10){return CustomReport[_0x699f[51]]({method:[_0x699f[102],{CustomReportId:_0x742bxf[_0x699f[48]][_0x699f[47]]}]})[_0x699f[49]](_0x742bxf[_0x699f[48]][_0x699f[47]],{attributes:[_0x699f[100],_0x699f[101],_0x699f[88],_0x699f[87],_0x699f[42]]})[_0x699f[20]](function(_0x742bx18){if(!_0x742bx18){return _0x742bx10[_0x699f[35]](404)};return _0x742bx10[_0x699f[18]](_0x742bx18)})[_0x699f[17]](function(_0x742bx12){return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[103]]= function(_0x742bxf,_0x742bx10){var _0x742bx2d;return sequelize[_0x699f[108]](function(_0x742bx2e){return CustomReport[_0x699f[51]](_0x699f[50])[_0x699f[49]](_0x742bxf[_0x699f[48]][_0x699f[47]])[_0x699f[20]](function(_0x742bx18){if(!_0x742bx18){return _0x742bx10[_0x699f[35]](404)};var _0x742bx2f=_0x742bx18[_0x699f[43]];delete _0x742bx2f[_0x699f[47]];delete _0x742bx2f[_0x699f[104]];delete _0x742bx2f[_0x699f[105]];_0x742bx2f[_0x699f[87]]= _0x742bxf[_0x699f[106]][_0x699f[87]];_0x742bx2d= _[_0x699f[107]](_0x742bx2f.Fields,_0x699f[43]);return CustomReport[_0x699f[94]](_0x742bx2f,{transaction:_0x742bx2e})})[_0x699f[20]](function(_0x742bx18){return [_0x742bx18,_0x742bx2d]})[_0x699f[31]](createFields(_0x742bx2e))})[_0x699f[20]](function(){return _0x742bx10[_0x699f[35]](201)})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x742bx12);return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[94]]= function(_0x742bxf,_0x742bx10){var _0x742bx16;return sequelize[_0x699f[108]](function(_0x742bx2e){return CustomReport[_0x699f[94]](_0x742bxf[_0x699f[106]],{transaction:_0x742bx2e})[_0x699f[20]](function(_0x742bx18){_0x742bx16= _0x742bx18;return [_0x742bx16,_0x742bxf[_0x699f[106]][_0x699f[109]]]})[_0x699f[31]](createFields(_0x742bx2e))})[_0x699f[20]](function(){return _0x742bx10[_0x699f[19]](201)[_0x699f[18]](_0x742bx16)})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x742bx12);return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[110]]= function(_0x742bxf,_0x742bx10){var _0x742bx16;return sequelize[_0x699f[108]](function(_0x742bx2e){return CustomReport[_0x699f[94]](_0x742bxf[_0x699f[106]],{transaction:_0x742bx2e})[_0x699f[20]](function(_0x742bx18){_0x742bx16= _0x742bx18;return [_0x742bx16,_0x742bxf[_0x699f[106]][_0x699f[109]]]})[_0x699f[31]](createImportFields(_0x742bx2e))})[_0x699f[20]](function(){return _0x742bx10[_0x699f[19]](201)[_0x699f[18]](_0x742bx16)})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x742bx12);return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[111]]= function(_0x742bxf,_0x742bx10,_0x742bx11){if(_0x742bxf[_0x699f[106]][_0x699f[47]]){delete _0x742bxf[_0x699f[106]][_0x699f[47]]};var _0x742bx16;return sequelize[_0x699f[108]](function(_0x742bx2e){return CustomReport[_0x699f[49]](_0x742bxf[_0x699f[48]][_0x699f[47]])[_0x699f[20]](function(_0x742bx18){if(!_0x742bx18){return _0x742bx10[_0x699f[35]](404)};var _0x742bx30=_[_0x699f[112]](_0x742bx18,_0x742bxf[_0x699f[106]]);return _0x742bx18[_0x699f[113]]({transaction:_0x742bx2e})})[_0x699f[20]](function(_0x742bx18){_0x742bx16= _0x742bx18;if(_0x742bxf[_0x699f[106]][_0x699f[109]]){return ReportField[_0x699f[74]]({where:{CustomReportId:_0x742bxf[_0x699f[48]][_0x699f[47]]},transaction:_0x742bx2e})}})[_0x699f[20]](function(){return [_0x742bx16,_0x742bxf[_0x699f[106]][_0x699f[109]]]})[_0x699f[31]](createFields(_0x742bx2e))})[_0x699f[20]](function(){return _0x742bx10[_0x699f[35]](200)})[_0x699f[17]](function(_0x742bx12){console[_0x699f[26]](_0x742bx12);return handleError(_0x742bx10,_0x742bx12)})};function createFields(_0x742bx2e){return function(_0x742bx18,_0x742bx32){if(_0x742bx32&& Array[_0x699f[53]](_0x742bx32)&& _0x742bx32[_0x699f[54]]){var _0x742bx33=reportBuildUtils[_0x699f[114]](_0x742bx18[_0x699f[42]]);if(_0x742bx33){var _0x742bx34;return _0x742bx33[_0x699f[127]]()[_0x699f[20]](function(_0x742bx39){_0x742bx34= _[_0x699f[125]](_0x742bx39);return Metric[_0x699f[126]]()})[_0x699f[20]](function(_0x742bx35){var _0x742bx36=[];_0x742bx35= _[_0x699f[107]](_0x742bx35,_0x699f[43]);_0x742bx32[_0x699f[62]](function(_0x742bx37){_0x742bx37[_0x699f[115]]= _0x742bx18[_0x699f[47]];if(_0x742bx37[_0x699f[116]]){var _0x742bx38=_[_0x699f[72]](_0x742bx35,{id:_0x742bx37[_0x699f[116]]});if(_0x742bx38){_0x742bx37[_0x699f[117]]= _0x742bx38[_0x699f[118]];_0x742bx36[_0x699f[75]](ReportField[_0x699f[94]](_0x742bx37,{transaction:_0x742bx2e}))}else {throw  new sequelize.Error(_0x699f[119]+ _0x742bx37[_0x699f[116]]+ _0x699f[120])}}else {if(_[_0x699f[121]](_0x742bx34,_0x742bx37[_0x699f[117]])|| _0x742bx37[_0x699f[122]]){_0x742bx36[_0x699f[75]](ReportField[_0x699f[94]](_0x742bx37,{transaction:_0x742bx2e}))}else {throw  new sequelize.Error(_0x699f[123]+ _0x742bx37[_0x699f[117]]+ _0x699f[124])}}});return _0x742bx36})[_0x699f[29]]()}else {throw  new sequelize.Error(_0x699f[128])}}}}function createImportFields(_0x742bx2e){return function(_0x742bx18,_0x742bx32){if(_0x742bx32&& Array[_0x699f[53]](_0x742bx32)&& _0x742bx32[_0x699f[54]]){var _0x742bx33=reportBuildUtils[_0x699f[114]](_0x742bx18[_0x699f[42]]);if(_0x742bx33){var _0x742bx34;return _0x742bx33[_0x699f[127]]()[_0x699f[20]](function(_0x742bx39){_0x742bx34= _[_0x699f[125]](_0x742bx39);var _0x742bx36=[];var _0x742bx3b;if(_[_0x699f[131]](_0x742bx32,function(_0x742bx37){return _[_0x699f[130]](_0x742bx37,_0x699f[129])})){_0x742bx3b= _0x699f[132]}else {if(_[_0x699f[131]](_0x742bx32,function(_0x742bx37){return _[_0x699f[130]](_0x742bx37,_0x699f[116])})){_0x742bx3b= _0x699f[7]}else {throw  new sequelize.Error(_0x699f[133])}};var _0x742bx3c=_[_0x699f[135]](_0x742bx32,_0x742bx3b+ _0x699f[134]);_[_0x699f[61]](_0x742bx3c,function(_0x742bx3d,_0x742bx1d){if(_0x742bx1d!== _0x699f[136]&& _0x742bx1d!== _0x699f[137]){_0x742bx3d[0][_0x742bx3b][_0x699f[138]][_0x699f[62]](function(_0x742bx37){_0x742bx37[_0x699f[115]]= _0x742bx18[_0x699f[47]]});_0x742bx3d[0][_0x742bx3b][_0x699f[88]]+= _0x699f[139]+ sr({length:5});_0x742bx36[_0x699f[75]](Metric[_0x699f[94]](_0x742bx3d[0][_0x742bx3b],{include:[{model:ReportField,as:_0x699f[138]}],transaction:_0x742bx2e}))}else {_0x742bx3d[_0x699f[62]](function(_0x742bx37){if(_[_0x699f[121]](_0x742bx34,_0x742bx37[_0x699f[117]])|| _0x742bx37[_0x699f[122]]){_0x742bx37[_0x699f[115]]= _0x742bx18[_0x699f[47]];_0x742bx36[_0x699f[75]](ReportField[_0x699f[94]](_0x742bx37,{transaction:_0x742bx2e}))}else {throw  new sequelize.Error(_0x699f[123]+ _0x742bx37[_0x699f[117]]+ _0x699f[124])}})}});return _0x742bx36})[_0x699f[29]]()}else {throw  new sequelize.Error(_0x699f[128])}}}}exports[_0x699f[74]]= function(_0x742bxf,_0x742bx10){return CustomReport[_0x699f[49]](_0x742bxf[_0x699f[48]][_0x699f[47]])[_0x699f[20]](function(_0x742bx18){if(!_0x742bx18){return _0x742bx10[_0x699f[35]](404)};return _0x742bx18[_0x699f[74]]()})[_0x699f[20]](function(){return _0x742bx10[_0x699f[35]](204)})[_0x699f[17]](function(_0x742bx12){return handleError(_0x742bx10,_0x742bx12)})};exports[_0x699f[140]]= function(_0x742bxf,_0x742bx10){return CustomReport[_0x699f[74]]({where:{id:_0x742bxf[_0x699f[21]][_0x699f[141]]},individualHooks:true})[_0x699f[20]](function(){return _0x742bx10[_0x699f[35]](204)})[_0x699f[17]](function(_0x742bx12){return handleError(_0x742bx10,_0x742bx12)})};function handleError(_0x742bx10,_0x742bx12){return _0x742bx10[_0x699f[19]](500)[_0x699f[18]](_0x742bx12)}
\ No newline at end of file