3250f7189cdba1ff35e06e75e06b317168b3a8c1
[motion.git] / server / api / custom_report / custom_report.controller.js
1 var _0x7f45=["\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","\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","\x70\x61\x72\x61\x6D\x73","\x6D\x65\x72\x67\x65","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x70\x72\x65\x76\x69\x65\x77","\x6C\x6F\x67","\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","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x52\x65\x70\x6F\x72\x74","\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","\x66\x69\x6E\x64\x42\x79\x49\x64","\x66\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\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","\x65\x78\x74\x72\x61\x63\x74","\x73\x70\x72\x65\x61\x64","\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","\x73\x61\x76\x65","\x69\x73\x41\x72\x72\x61\x79","\x61\x6C\x6C","\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","\x66\x6F\x72\x45\x61\x63\x68","\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","\x66\x6F\x72\x4F\x77\x6E","\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"];_0x7f45[0];var _=require(_0x7f45[1]);var util=require(_0x7f45[2]);var sequelize=require(_0x7f45[4])[_0x7f45[3]];var CustomReport=require(_0x7f45[4])[_0x7f45[5]];var ReportField=require(_0x7f45[4])[_0x7f45[6]];var Metric=require(_0x7f45[4])[_0x7f45[7]];var ExtractedReport=require(_0x7f45[4])[_0x7f45[8]];var extractUtils=require(_0x7f45[9]);var reportBuildUtils=require(_0x7f45[10]);var Util=require(_0x7f45[11]);var sr=require(_0x7f45[12]);var moment=require(_0x7f45[13]);exports[_0x7f45[14]]=function(_0xb1a9xd,_0xb1a9xe,_0xb1a9xf){return CustomReport[_0x7f45[23]](Util[_0x7f45[22]](_[_0x7f45[21]](_0xb1a9xd[_0x7f45[19]],_0xb1a9xd[_0x7f45[20]])))[_0x7f45[18]](function(_0xb1a9x11){_0xb1a9xe[_0x7f45[17]](200)[_0x7f45[16]](_0xb1a9x11)})[_0x7f45[15]](function(_0xb1a9x10){return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[24]]=function(_0xb1a9xd,_0xb1a9xe){var _0xb1a9x12;return CustomReport[_0x7f45[52]](_0x7f45[51])[_0x7f45[50]](_0xb1a9xd[_0x7f45[20]][_0x7f45[49]])[_0x7f45[18]](function(_0xb1a9x15){console[_0x7f45[25]](_0x7f45[36]);if(!_0xb1a9x15){return _0xb1a9xe[_0x7f45[37]](404)};if(_0xb1a9xd[_0x7f45[19]][_0x7f45[38]]&&_0xb1a9xd[_0x7f45[19]][_0x7f45[38]]===_0x7f45[39]){_0xb1a9xd[_0x7f45[19]][_0x7f45[40]]=moment()[_0x7f45[42]](_0x7f45[41]);_0xb1a9xd[_0x7f45[19]][_0x7f45[43]]=moment()[_0x7f45[42]](_0x7f45[41]);_0xb1a9x15[_0x7f45[45]][_0x7f45[44]]=_0xb1a9x15[_0x7f45[45]][_0x7f45[44]][_0x7f45[48]](_0x7f45[46],_0x7f45[47])};delete _0xb1a9xd[_0x7f45[19]][_0x7f45[38]];return _0xb1a9x15[_0x7f45[45]]})[_0x7f45[18]](reportBuildUtils[_0x7f45[35]](_0xb1a9xd[_0x7f45[34]],_0xb1a9xd[_0x7f45[19]]))[_0x7f45[18]](function(_0xb1a9x14){return _0xb1a9x14?sequelize[_0x7f45[19]](_0xb1a9x14,{type:sequelize[_0x7f45[33]][_0x7f45[32]]}):[]})[_0x7f45[18]](function(_0xb1a9x13){_0xb1a9x12=_0xb1a9x13[_0x7f45[26]];if(_0xb1a9xd[_0x7f45[19]][_0x7f45[27]]){_0xb1a9x13=_(_0xb1a9x13)[_0x7f45[31]](_0xb1a9xd[_0x7f45[19]][_0x7f45[30]]||0)[_0x7f45[29]](_0xb1a9xd[_0x7f45[19]][_0x7f45[27]])[_0x7f45[28]]()};_0xb1a9xe[_0x7f45[17]](200)[_0x7f45[16]]({rows:_0xb1a9x13,count:_0xb1a9x12})})[_0x7f45[15]](function(_0xb1a9x10){console[_0x7f45[25]](_0xb1a9x10);return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[53]]=function(_0xb1a9xd,_0xb1a9xe){docExtract(_0xb1a9xd,_0xb1a9xe,_0x7f45[54])};exports[_0x7f45[55]]=function(_0xb1a9xd,_0xb1a9xe){docExtract(_0xb1a9xd,_0xb1a9xe,_0x7f45[56])};function docExtract(_0xb1a9xd,_0xb1a9xe,_0xb1a9x17){CustomReport[_0x7f45[52]](_0x7f45[51])[_0x7f45[50]](_0xb1a9xd[_0x7f45[20]][_0x7f45[49]])[_0x7f45[18]](function(_0xb1a9x15){if(!_0xb1a9x15){return _0xb1a9xe[_0x7f45[37]](404)};if(_0xb1a9xd[_0x7f45[19]][_0x7f45[38]]&&_0xb1a9xd[_0x7f45[19]][_0x7f45[38]]===_0x7f45[39]){_0xb1a9xd[_0x7f45[19]][_0x7f45[40]]=moment()[_0x7f45[42]](_0x7f45[41]);_0xb1a9xd[_0x7f45[19]][_0x7f45[43]]=moment()[_0x7f45[42]](_0x7f45[41]);_0xb1a9x15[_0x7f45[45]][_0x7f45[44]]=_0xb1a9x15[_0x7f45[45]][_0x7f45[44]][_0x7f45[48]](_0x7f45[46],_0x7f45[47])};delete _0xb1a9xd[_0x7f45[19]][_0x7f45[38]];return [_0xb1a9x15,ExtractedReport[_0x7f45[60]]({name:_0xb1a9x15[_0x7f45[59]],startDate:_0xb1a9xd[_0x7f45[19]][_0x7f45[40]]||null,endDate:_0xb1a9xd[_0x7f45[19]][_0x7f45[43]]||null,output:_0xb1a9x17,UserId:_0xb1a9xd[_0x7f45[34]][_0x7f45[49]]})]})[_0x7f45[58]](function(_0xb1a9x15,_0xb1a9x18){extractUtils[_0x7f45[57]+_0xb1a9x17](_0xb1a9x15,_0xb1a9xd[_0x7f45[19]],_0xb1a9x18[_0x7f45[49]],_0xb1a9xd[_0x7f45[34]])})[_0x7f45[15]](function(_0xb1a9x10){console[_0x7f45[25]](_0xb1a9x10);return handleError(_0xb1a9xe,_0xb1a9x10)});return _0xb1a9xe[_0x7f45[37]](200)}exports[_0x7f45[61]]=function(_0xb1a9xd,_0xb1a9xe){return CustomReport[_0x7f45[52]](_0x7f45[51])[_0x7f45[50]](_0xb1a9xd[_0x7f45[20]][_0x7f45[49]])[_0x7f45[18]](function(_0xb1a9x15){if(!_0xb1a9x15){return _0xb1a9xe[_0x7f45[37]](404)};return _0xb1a9xe[_0x7f45[16]](_0xb1a9x15)})[_0x7f45[15]](function(_0xb1a9x10){return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[62]]=function(_0xb1a9xd,_0xb1a9xe){return CustomReport[_0x7f45[52]]({method:[_0x7f45[66],{CustomReportId:_0xb1a9xd[_0x7f45[20]][_0x7f45[49]]}]})[_0x7f45[50]](_0xb1a9xd[_0x7f45[20]][_0x7f45[49]],{attributes:[_0x7f45[63],_0x7f45[64],_0x7f45[59],_0x7f45[65],_0x7f45[44]]})[_0x7f45[18]](function(_0xb1a9x15){if(!_0xb1a9x15){return _0xb1a9xe[_0x7f45[37]](404)};return _0xb1a9xe[_0x7f45[16]](_0xb1a9x15)})[_0x7f45[15]](function(_0xb1a9x10){return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[67]]=function(_0xb1a9xd,_0xb1a9xe){var _0xb1a9x19;return sequelize[_0x7f45[72]](function(_0xb1a9x1a){return CustomReport[_0x7f45[52]](_0x7f45[51])[_0x7f45[50]](_0xb1a9xd[_0x7f45[20]][_0x7f45[49]])[_0x7f45[18]](function(_0xb1a9x15){if(!_0xb1a9x15){return _0xb1a9xe[_0x7f45[37]](404)};var _0xb1a9x1b=_0xb1a9x15[_0x7f45[45]];delete _0xb1a9x1b[_0x7f45[49]];delete _0xb1a9x1b[_0x7f45[68]];delete _0xb1a9x1b[_0x7f45[69]];_0xb1a9x1b[_0x7f45[65]]=_0xb1a9xd[_0x7f45[70]][_0x7f45[65]];_0xb1a9x19=_[_0x7f45[71]](_0xb1a9x1b.Fields,_0x7f45[45]);return CustomReport[_0x7f45[60]](_0xb1a9x1b,{transaction:_0xb1a9x1a})})[_0x7f45[18]](function(_0xb1a9x15){return [_0xb1a9x15,_0xb1a9x19]})[_0x7f45[58]](createFields(_0xb1a9x1a))})[_0x7f45[18]](function(){return _0xb1a9xe[_0x7f45[37]](201)})[_0x7f45[15]](function(_0xb1a9x10){console[_0x7f45[25]](_0xb1a9x10);return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[60]]=function(_0xb1a9xd,_0xb1a9xe){var _0xb1a9x1c;return sequelize[_0x7f45[72]](function(_0xb1a9x1a){return CustomReport[_0x7f45[60]](_0xb1a9xd[_0x7f45[70]],{transaction:_0xb1a9x1a})[_0x7f45[18]](function(_0xb1a9x15){_0xb1a9x1c=_0xb1a9x15;return [_0xb1a9x1c,_0xb1a9xd[_0x7f45[70]][_0x7f45[73]]]})[_0x7f45[58]](createFields(_0xb1a9x1a))})[_0x7f45[18]](function(){return _0xb1a9xe[_0x7f45[17]](201)[_0x7f45[16]](_0xb1a9x1c)})[_0x7f45[15]](function(_0xb1a9x10){console[_0x7f45[25]](_0xb1a9x10);return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[74]]=function(_0xb1a9xd,_0xb1a9xe){var _0xb1a9x1c;return sequelize[_0x7f45[72]](function(_0xb1a9x1a){return CustomReport[_0x7f45[60]](_0xb1a9xd[_0x7f45[70]],{transaction:_0xb1a9x1a})[_0x7f45[18]](function(_0xb1a9x15){_0xb1a9x1c=_0xb1a9x15;return [_0xb1a9x1c,_0xb1a9xd[_0x7f45[70]][_0x7f45[73]]]})[_0x7f45[58]](createImportFields(_0xb1a9x1a))})[_0x7f45[18]](function(){return _0xb1a9xe[_0x7f45[17]](201)[_0x7f45[16]](_0xb1a9x1c)})[_0x7f45[15]](function(_0xb1a9x10){console[_0x7f45[25]](_0xb1a9x10);return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[75]]=function(_0xb1a9xd,_0xb1a9xe,_0xb1a9xf){if(_0xb1a9xd[_0x7f45[70]][_0x7f45[49]]){delete _0xb1a9xd[_0x7f45[70]][_0x7f45[49]]};var _0xb1a9x1c;return sequelize[_0x7f45[72]](function(_0xb1a9x1a){return CustomReport[_0x7f45[50]](_0xb1a9xd[_0x7f45[20]][_0x7f45[49]])[_0x7f45[18]](function(_0xb1a9x15){if(!_0xb1a9x15){return _0xb1a9xe[_0x7f45[37]](404)};var _0xb1a9x1d=_[_0x7f45[21]](_0xb1a9x15,_0xb1a9xd[_0x7f45[70]]);return _0xb1a9x15[_0x7f45[77]]({transaction:_0xb1a9x1a})})[_0x7f45[18]](function(_0xb1a9x15){_0xb1a9x1c=_0xb1a9x15;if(_0xb1a9xd[_0x7f45[70]][_0x7f45[73]]){return ReportField[_0x7f45[76]]({where:{CustomReportId:_0xb1a9xd[_0x7f45[20]][_0x7f45[49]]},transaction:_0xb1a9x1a})}})[_0x7f45[18]](function(){return [_0xb1a9x1c,_0xb1a9xd[_0x7f45[70]][_0x7f45[73]]]})[_0x7f45[58]](createFields(_0xb1a9x1a))})[_0x7f45[18]](function(){return _0xb1a9xe[_0x7f45[37]](200)})[_0x7f45[15]](function(_0xb1a9x10){console[_0x7f45[25]](_0xb1a9x10);return handleError(_0xb1a9xe,_0xb1a9x10)})};function createFields(_0xb1a9x1a){return function(_0xb1a9x15,_0xb1a9x1f){if(_0xb1a9x1f&&Array[_0x7f45[78]](_0xb1a9x1f)&&_0xb1a9x1f[_0x7f45[26]]){var _0xb1a9x20=getTable(_0xb1a9x15[_0x7f45[44]]);if(_0xb1a9x20){var _0xb1a9x21;return _0xb1a9x20[_0x7f45[94]]()[_0x7f45[18]](function(_0xb1a9x26){_0xb1a9x21=_[_0x7f45[92]](_0xb1a9x26);return Metric[_0x7f45[93]]()})[_0x7f45[18]](function(_0xb1a9x22){var _0xb1a9x23=[];_0xb1a9x22=_[_0x7f45[71]](_0xb1a9x22,_0x7f45[45]);_0xb1a9x1f[_0x7f45[91]](function(_0xb1a9x24){_0xb1a9x24[_0x7f45[80]]=_0xb1a9x15[_0x7f45[49]];if(_0xb1a9x24[_0x7f45[81]]){var _0xb1a9x25=_[_0x7f45[82]](_0xb1a9x22,{id:_0xb1a9x24[_0x7f45[81]]});if(_0xb1a9x25){_0xb1a9x24[_0x7f45[83]]=_0xb1a9x25[_0x7f45[84]];_0xb1a9x23[_0x7f45[85]](ReportField[_0x7f45[60]](_0xb1a9x24,{transaction:_0xb1a9x1a}))}else {throw  new sequelize.Error(_0x7f45[86]+_0xb1a9x24[_0x7f45[81]]+_0x7f45[87])}}else {if(_[_0x7f45[88]](_0xb1a9x21,_0xb1a9x24[_0x7f45[83]])){_0xb1a9x23[_0x7f45[85]](ReportField[_0x7f45[60]](_0xb1a9x24,{transaction:_0xb1a9x1a}))}else {throw  new sequelize.Error(_0x7f45[89]+_0xb1a9x24[_0x7f45[83]]+_0x7f45[90])}}});return _0xb1a9x23})[_0x7f45[79]]()}else {throw  new sequelize.Error(_0x7f45[95])}}}}function createImportFields(_0xb1a9x1a){return function(_0xb1a9x15,_0xb1a9x1f){if(_0xb1a9x1f&&Array[_0x7f45[78]](_0xb1a9x1f)&&_0xb1a9x1f[_0x7f45[26]]){var _0xb1a9x20=getTable(_0xb1a9x15[_0x7f45[44]]);if(_0xb1a9x20){var _0xb1a9x21;return _0xb1a9x20[_0x7f45[94]]()[_0x7f45[18]](function(_0xb1a9x26){_0xb1a9x21=_[_0x7f45[92]](_0xb1a9x26);return Metric[_0x7f45[93]]()})[_0x7f45[18]](function(_0xb1a9x22){var _0xb1a9x23=[];var _0xb1a9x28=_[_0x7f45[96]](_0xb1a9x1f,_0x7f45[81]);_[_0x7f45[101]](_0xb1a9x28,function(_0xb1a9x29,_0xb1a9x2a){if(_0xb1a9x2a!==_0x7f45[97]&&_0xb1a9x2a!==_0x7f45[98]){_0xb1a9x29[0][_0x7f45[7]][_0x7f45[99]][_0x7f45[91]](function(_0xb1a9x24){_0xb1a9x24[_0x7f45[80]]=_0xb1a9x15[_0x7f45[49]]});_0xb1a9x29[0][_0x7f45[7]][_0x7f45[59]]+=_0x7f45[100]+sr({length:5});console[_0x7f45[25]](_0x7f45[84],_0xb1a9x29[0].Metric);_0xb1a9x23[_0x7f45[85]](Metric[_0x7f45[60]](_0xb1a9x29[0].Metric,{include:[{model:ReportField,as:_0x7f45[99]}],transaction:_0xb1a9x1a}))}else {_0xb1a9x29[_0x7f45[91]](function(_0xb1a9x24){if(_[_0x7f45[88]](_0xb1a9x21,_0xb1a9x24[_0x7f45[83]])){_0xb1a9x24[_0x7f45[80]]=_0xb1a9x15[_0x7f45[49]];_0xb1a9x23[_0x7f45[85]](ReportField[_0x7f45[60]](_0xb1a9x24,{transaction:_0xb1a9x1a}))}else {throw  new sequelize.Error(_0x7f45[89]+_0xb1a9x24[_0x7f45[83]]+_0x7f45[90])}})}});return _0xb1a9x23})[_0x7f45[79]]()}else {throw  new sequelize.Error(_0x7f45[95])}}}}function getTable(_0xb1a9x2c){var _0xb1a9x20;switch(_0xb1a9x2c){case _0x7f45[104]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[102]];break;case _0x7f45[106]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[105]];break;case _0x7f45[108]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[107]];break;case _0x7f45[110]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[109]];break;case _0x7f45[112]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[111]];break;case _0x7f45[114]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[113]];break;case _0x7f45[116]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[115]];break;case _0x7f45[118]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[103]][_0x7f45[117]];break;case _0x7f45[120]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[119]];break;case _0x7f45[122]:_0xb1a9x20=require(_0x7f45[4])[_0x7f45[121]];break;default:};return _0xb1a9x20}exports[_0x7f45[76]]=function(_0xb1a9xd,_0xb1a9xe){return CustomReport[_0x7f45[50]](_0xb1a9xd[_0x7f45[20]][_0x7f45[49]])[_0x7f45[18]](function(_0xb1a9x15){if(!_0xb1a9x15){return _0xb1a9xe[_0x7f45[37]](404)};return _0xb1a9x15[_0x7f45[76]]()})[_0x7f45[18]](function(){return _0xb1a9xe[_0x7f45[37]](204)})[_0x7f45[15]](function(_0xb1a9x10){return handleError(_0xb1a9xe,_0xb1a9x10)})};exports[_0x7f45[123]]=function(_0xb1a9xd,_0xb1a9xe){return CustomReport[_0x7f45[76]]({where:{id:_0xb1a9xd[_0x7f45[19]][_0x7f45[124]]},individualHooks:true})[_0x7f45[18]](function(){return _0xb1a9xe[_0x7f45[37]](204)})[_0x7f45[15]](function(_0xb1a9x10){return handleError(_0xb1a9xe,_0xb1a9x10)})};function handleError(_0xb1a9xe,_0xb1a9x10){return _0xb1a9xe[_0x7f45[17]](500)[_0x7f45[16]](_0xb1a9x10)}