Built motion from commit ec3309576.|1.0.33
[motion.git] / server / api / default_report / default_report.controller.js
1 var _0x9edb=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x44\x65\x66\x61\x75\x6C\x74\x52\x65\x70\x6F\x72\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x4D\x65\x74\x72\x69\x63","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74","\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","\x6D\x6F\x6D\x65\x6E\x74","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x73\x69\x6D\x70\x6C\x65\x2D\x72\x61\x6E\x64\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x54\x72\x65\x65","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x65\x78\x70\x6F\x72\x74","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x63\x6F\x6E\x64\x69\x74\x69\x6F\x6E\x73","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x6E\x61\x6D\x65","\x70\x61\x72\x65\x6E\x74","\x74\x61\x62\x6C\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x65\x78\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x73\x63\x6F\x70\x65","\x67\x65\x74\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x72\x79","\x45\x72\x72\x6F\x72\x20\x67\x65\x74\x74\x69\x6E\x67\x20\x71\x75\x65\x72\x79\x20\x66\x72\x6F\x6D\x20\x61\x70\x69\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x6E\x6F\x20\x73\x75\x66\x66\x69\x63\x69\x65\x6E\x74\x20\x71\x75\x65\x75\x65\x20\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E\x73\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x75\x73\x65\x72","\x70\x65\x72\x6D\x69\x73\x73\x69\x6F\x6E","\x61\x6C\x6C","\x62\x75\x69\x6C\x64\x51\x75\x65\x72\x79","\x73\x70\x72\x65\x61\x64","\x75\x73\x65\x72","\x62\x75\x69\x6C\x64\x46\x69\x6C\x74\x65\x72","\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","\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","\x66\x69\x65\x6C\x64\x73","\x70\x72\x65\x76\x69\x65\x77","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x6F\x66\x66\x73\x65\x74","\x73\x6C\x69\x63\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x4F\x77\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x72\x79\x20\x65\x72\x72\x6F\x72","\x63\x68\x65\x63\x6B\x51\x75\x65\x72\x79","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66","\x65\x78\x74\x72\x61\x63\x74\x50\x64\x66\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x64\x65\x62\x75\x67","\x50\x44\x46","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76","\x65\x78\x74\x72\x61\x63\x74\x43\x73\x76\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x53\x56","\x63\x6F\x6D\x6D\x6F\x6E\x20\x64\x6F\x63\x45\x78\x74\x72\x61\x63\x74\x20\x61\x70\x69\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x43\x72\x65\x61\x74\x65\x64\x20\x6E\x65\x77\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x20\x64\x62\x20\x65\x6E\x74\x72\x79\x2C\x20\x63\x61\x6C\x6C\x69\x6E\x67\x20\x65\x78\x74\x65\x72\x6E\x61\x6C\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x66\x75\x6E\x63\x74\x69\x6F\x6E\x3A\x20","\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x75\x74\x69\x6C\x73\x2F\x72\x65\x70\x6F\x72\x74\x5F\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x2E\x6A\x73","\x66\x6F\x72\x6B","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x65\x72\x72\x6F\x72","\x6F\x6E","\x63\x6C\x6F\x73\x65","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x63\x6C\x6F\x73\x65","\x6D\x65\x73\x73\x61\x67\x65","\x52\x65\x70\x6F\x72\x74\x20\x65\x78\x74\x72\x61\x63\x74\x69\x6F\x6E\x20\x70\x72\x6F\x63\x65\x73\x73\x20\x6D\x65\x73\x73\x61\x67\x65","\x6B\x69\x6C\x6C","\x74\x72\x65\x65","\x70\x61\x72\x73\x65","\x66\x69\x6E\x64","\x46\x6F\x75\x6E\x64\x20\x74\x68\x65\x20\x72\x65\x70\x6F\x72\x74\x2C\x20\x63\x72\x65\x61\x74\x69\x6E\x67\x20\x74\x68\x65\x20\x6E\x65\x77\x20\x44\x42\x20\x72\x6F\x77\x20\x66\x6F\x72\x20\x65\x78\x74\x72\x61\x63\x74\x65\x64\x20\x72\x65\x70\x6F\x72\x74\x73\x2E\x2E","\x73\x74\x61\x72\x74\x54\x69\x6D\x65","\x20","\x30\x30\x3A\x30\x30","\x65\x6E\x64\x54\x69\x6D\x65","\x32\x33\x3A\x35\x39","\x63\x72\x65\x61\x74\x65","\x74\x65\x78\x74","\x2F\x20","\x23","\x73\x68\x6F\x77","\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","\x67\x65\x74\x54\x61\x62\x6C\x65","\x6B\x65\x79\x73","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63\x49\x64","\x67\x72\x6F\x75\x70\x42\x79","\x75\x6E\x64\x65\x66\x69\x6E\x65\x64","\x6E\x75\x6C\x6C","\x43\x75\x73\x74\x6F\x6D\x52\x65\x70\x6F\x72\x74\x49\x64","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64\x73","\x44\x65\x66\x61\x75\x6C\x74\x4D\x65\x74\x72\x69\x63","\x5F","\x70\x75\x73\x68","\x66\x69\x65\x6C\x64","\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","\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","\x75\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79"];_0x9edb[0];var _=require(_0x9edb[1]);var util=require(_0x9edb[2]);var DefaultReport=require(_0x9edb[4])[_0x9edb[3]];var ReportField=require(_0x9edb[4])[_0x9edb[5]];var Metric=require(_0x9edb[4])[_0x9edb[6]];var sequelize=require(_0x9edb[4])[_0x9edb[7]];var CustomReport=require(_0x9edb[4])[_0x9edb[8]];var ExtractedReport=require(_0x9edb[4])[_0x9edb[9]];var extractUtils=require(_0x9edb[10]);var reportBuildUtils=require(_0x9edb[11]);var Util=require(_0x9edb[12]);var moment=require(_0x9edb[13]);var cp=require(_0x9edb[14]);var sr=require(_0x9edb[15]);var ReportTree=require(_0x9edb[4])[_0x9edb[16]];var logger=require(_0x9edb[18])(_0x9edb[17]);exports[_0x9edb[19]]= function(_0xd0f2x11,_0xd0f2x12,_0xd0f2x13){return DefaultReport[_0x9edb[26]](Util[_0x9edb[25]](_0xd0f2x11[_0x9edb[24]]))[_0x9edb[23]](function(_0xd0f2x15){_0xd0f2x12[_0x9edb[22]](200)[_0x9edb[21]](_0xd0f2x15)})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};exports[_0x9edb[27]]= function(_0xd0f2x11,_0xd0f2x12){return DefaultReport[_0x9edb[38]]({method:[_0x9edb[37],{DefaultReportId:_0xd0f2x11[_0x9edb[30]][_0x9edb[29]]}]})[_0x9edb[36]](_0xd0f2x11[_0x9edb[30]][_0x9edb[29]],{attributes:[_0x9edb[31],_0x9edb[32],_0x9edb[33],_0x9edb[34],_0x9edb[35]]})[_0x9edb[23]](function(_0xd0f2x16){if(!_0xd0f2x16){return _0xd0f2x12[_0x9edb[28]](404)};return _0xd0f2x12[_0x9edb[21]](_0xd0f2x16)})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};exports[_0x9edb[39]]= function(_0xd0f2x11,_0xd0f2x12){return Promise[_0x9edb[45]]([])[_0x9edb[23]](getQuery(_0xd0f2x11,_0xd0f2x12))[_0x9edb[23]](function(_0xd0f2x17){if(_0xd0f2x17){switch(_0xd0f2x17){case _0x9edb[44]:_0xd0f2x17= _0x9edb[43];break;default:}};_0xd0f2x12[_0x9edb[22]](200)[_0x9edb[21]]({query:_0xd0f2x17})})[_0x9edb[20]](function(_0xd0f2x14){logger[_0x9edb[42]](_0x9edb[40],_0xd0f2x14[_0x9edb[41]])})};function getQuery(_0xd0f2x11,_0xd0f2x12){var _0xd0f2x19;return function(){return DefaultReport[_0x9edb[38]](_0x9edb[60])[_0x9edb[36]](_0xd0f2x11[_0x9edb[30]][_0x9edb[29]])[_0x9edb[23]](function(_0xd0f2x16){if(!_0xd0f2x16){return _0xd0f2x12[_0x9edb[28]](404)};if(_0xd0f2x11[_0x9edb[24]][_0x9edb[50]]&& _0xd0f2x11[_0x9edb[24]][_0x9edb[50]]=== _0x9edb[51]){_0xd0f2x11[_0x9edb[24]][_0x9edb[52]]= moment()[_0x9edb[54]](_0x9edb[53]);_0xd0f2x11[_0x9edb[24]][_0x9edb[55]]= moment()[_0x9edb[54]](_0x9edb[53]);_0xd0f2x16[_0x9edb[56]][_0x9edb[35]]= _0xd0f2x16[_0x9edb[56]][_0x9edb[35]][_0x9edb[59]](_0x9edb[57],_0x9edb[58])};delete _0xd0f2x11[_0x9edb[24]][_0x9edb[50]];_0xd0f2x19= _0xd0f2x16[_0x9edb[56]];return _0xd0f2x19[_0x9edb[35]]})[_0x9edb[23]](reportBuildUtils[_0x9edb[49]](_0xd0f2x11[_0x9edb[48]]))[_0x9edb[23]](function(_0xd0f2x1a){return [_0xd0f2x1a,_0xd0f2x19]})[_0x9edb[47]](reportBuildUtils[_0x9edb[46]](_0xd0f2x11[_0x9edb[24]]))}}exports[_0x9edb[61]]= function(_0xd0f2x11,_0xd0f2x12){var _0xd0f2x1b;return Promise[_0x9edb[45]]([])[_0x9edb[23]](getQuery(_0xd0f2x11,_0xd0f2x12))[_0x9edb[23]](reportBuildUtils[_0x9edb[73]]())[_0x9edb[23]](function(_0xd0f2x1c){if(_0xd0f2x1c&& _[_0x9edb[62]](_0xd0f2x1c)){_0xd0f2x1b= _0xd0f2x1c[_0x9edb[63]];if(_0xd0f2x11[_0x9edb[24]][_0x9edb[64]]){_0xd0f2x1c= _(_0xd0f2x1c)[_0x9edb[68]](_0xd0f2x11[_0x9edb[24]][_0x9edb[67]]|| 0)[_0x9edb[66]](_0xd0f2x11[_0x9edb[24]][_0x9edb[64]])[_0x9edb[65]]()};_[_0x9edb[71]](_0xd0f2x1c,function(_0xd0f2x1d){_[_0x9edb[70]](_0xd0f2x1d,function(_0xd0f2x1e,_0xd0f2x1f){if(_0xd0f2x1e instanceof  Date){_0xd0f2x1d[_0xd0f2x1f]= moment(_0xd0f2x1e)[_0x9edb[54]](_0x9edb[69]).toString()}})});_0xd0f2x12[_0x9edb[22]](200)[_0x9edb[21]]({rows:_0xd0f2x1c,count:_0xd0f2x1b})}else {return handleError(_0xd0f2x12,{message:_0xd0f2x1c|| _0x9edb[72]})}})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};exports[_0x9edb[74]]= function(_0xd0f2x11,_0xd0f2x12){logger[_0x9edb[76]](_0x9edb[75]);docExtract(_0xd0f2x11,_0xd0f2x12,_0x9edb[77])};exports[_0x9edb[78]]= function(_0xd0f2x11,_0xd0f2x12){logger[_0x9edb[76]](_0x9edb[79]);docExtract(_0xd0f2x11,_0xd0f2x12,_0x9edb[80])};function docExtract(_0xd0f2x11,_0xd0f2x12,_0xd0f2x21){var _0xd0f2x16;logger[_0x9edb[76]](_0x9edb[81]);DefaultReport[_0x9edb[38]](_0x9edb[60])[_0x9edb[36]](_0xd0f2x11[_0x9edb[30]][_0x9edb[29]])[_0x9edb[23]](function(_0xd0f2x19){if(!_0xd0f2x19){return _0xd0f2x12[_0x9edb[28]](404)};_0xd0f2x16= _0xd0f2x19;return ReportTree[_0x9edb[36]](1)})[_0x9edb[23]](function(_0xd0f2x25){_0xd0f2x25= JSON[_0x9edb[93]](_0xd0f2x25[_0x9edb[92]]);var _0xd0f2x26=_[_0x9edb[94]](_0xd0f2x25,{id:_0xd0f2x16[_0x9edb[34]]});var _0xd0f2x27=getReportPath(_0xd0f2x26,_0xd0f2x25,_0xd0f2x16[_0x9edb[33]]);logger[_0x9edb[76]](_0x9edb[95]);if(_0xd0f2x11[_0x9edb[24]][_0x9edb[50]]&& _0xd0f2x11[_0x9edb[24]][_0x9edb[50]]=== _0x9edb[51]){_0xd0f2x11[_0x9edb[24]][_0x9edb[52]]= moment()[_0x9edb[54]](_0x9edb[53]);_0xd0f2x11[_0x9edb[24]][_0x9edb[55]]= moment()[_0x9edb[54]](_0x9edb[53]);_0xd0f2x16[_0x9edb[56]][_0x9edb[35]]= _0xd0f2x16[_0x9edb[56]][_0x9edb[35]][_0x9edb[59]](_0x9edb[57],_0x9edb[58])};delete _0xd0f2x11[_0x9edb[24]][_0x9edb[50]];return [_0xd0f2x16,ExtractedReport[_0x9edb[101]]({name:_0xd0f2x27,startDate:_0xd0f2x11[_0x9edb[24]][_0x9edb[52]]?_0xd0f2x11[_0x9edb[24]][_0x9edb[52]]+ (_0xd0f2x11[_0x9edb[24]][_0x9edb[96]]?_0x9edb[97]+ _0xd0f2x11[_0x9edb[24]][_0x9edb[96]]:_0x9edb[98]):null,endDate:_0xd0f2x11[_0x9edb[24]][_0x9edb[55]]?_0xd0f2x11[_0x9edb[24]][_0x9edb[55]]+ (_0xd0f2x11[_0x9edb[24]][_0x9edb[99]]?_0x9edb[97]+ _0xd0f2x11[_0x9edb[24]][_0x9edb[99]]:_0x9edb[100]):null,output:_0xd0f2x21,UserId:_0xd0f2x11[_0x9edb[48]][_0x9edb[29]]})]})[_0x9edb[47]](function(_0xd0f2x16,_0xd0f2x22){logger[_0x9edb[76]](_0x9edb[82]+ _0xd0f2x21);var _0xd0f2x23=cp[_0x9edb[84]](__dirname+ _0x9edb[83]);_0xd0f2x23[_0x9edb[86]](_0x9edb[89],function(_0xd0f2x24){logger[_0x9edb[76]](_0x9edb[90],_0xd0f2x24);_0xd0f2x23[_0x9edb[91]]()})[_0x9edb[86]](_0x9edb[87],function(){logger[_0x9edb[76]](_0x9edb[88])})[_0x9edb[86]](_0x9edb[42],function(_0xd0f2x14){logger[_0x9edb[76]](_0x9edb[85],_0xd0f2x14)});_0xd0f2x23[_0x9edb[21]]({report:_0xd0f2x16,query:_0xd0f2x11[_0x9edb[24]],extractedId:_0xd0f2x22[_0x9edb[29]],user:_0xd0f2x11[_0x9edb[48]],type:_0xd0f2x21})})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)});return _0xd0f2x12[_0x9edb[28]](200)}function getReportPath(_0xd0f2x26,_0xd0f2x25,_0xd0f2x27){_0xd0f2x27= _0xd0f2x26[_0x9edb[102]]+ _0x9edb[103]+ _0xd0f2x27;if(_0xd0f2x26[_0x9edb[34]]=== _0x9edb[104]){return _0xd0f2x27}else {return getReportPath(_[_0x9edb[94]](_0xd0f2x25,{id:_0xd0f2x26[_0x9edb[34]]}),_0xd0f2x25,_0xd0f2x27)}}exports[_0x9edb[105]]= function(_0xd0f2x11,_0xd0f2x12){return DefaultReport[_0x9edb[36]](_0xd0f2x11[_0x9edb[30]][_0x9edb[29]],{include:[{all:true}]})[_0x9edb[23]](function(_0xd0f2x16){if(!_0xd0f2x16){return _0xd0f2x12[_0x9edb[28]](404)};return _0xd0f2x12[_0x9edb[21]](_0xd0f2x16)})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};exports[_0x9edb[106]]= function(_0xd0f2x11,_0xd0f2x12){var _0xd0f2x29;return sequelize[_0x9edb[111]](function(_0xd0f2x2a){return DefaultReport[_0x9edb[38]]({method:[_0x9edb[37],{DefaultReportId:_0xd0f2x11[_0x9edb[30]][_0x9edb[29]]}]})[_0x9edb[36]](_0xd0f2x11[_0x9edb[30]][_0x9edb[29]])[_0x9edb[23]](function(_0xd0f2x16){if(!_0xd0f2x16){return _0xd0f2x12[_0x9edb[28]](404)};var _0xd0f2x2b=_0xd0f2x16[_0x9edb[56]];delete _0xd0f2x2b[_0x9edb[29]];delete _0xd0f2x2b[_0x9edb[107]];delete _0xd0f2x2b[_0x9edb[108]];_0xd0f2x2b[_0x9edb[34]]= _0xd0f2x11[_0x9edb[109]][_0x9edb[34]];_0xd0f2x29= _[_0x9edb[110]](_0xd0f2x2b.Fields,_0x9edb[56]);return CustomReport[_0x9edb[101]](_0xd0f2x2b,{transaction:_0xd0f2x2a})})[_0x9edb[23]](function(_0xd0f2x16){return [_0xd0f2x16,_0xd0f2x29]})[_0x9edb[47]](createCopyFields(_0xd0f2x2a))})[_0x9edb[23]](function(){return _0xd0f2x12[_0x9edb[28]](201)})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};function createCopyFields(_0xd0f2x2a){return function(_0xd0f2x16,_0xd0f2x2d){if(_0xd0f2x2d&& Array[_0x9edb[62]](_0xd0f2x2d)&& _0xd0f2x2d[_0x9edb[63]]){var _0xd0f2x2e=reportBuildUtils[_0x9edb[112]](_0xd0f2x16[_0x9edb[35]]);if(_0xd0f2x2e){var _0xd0f2x2f;return _0xd0f2x2e[_0x9edb[128]]()[_0x9edb[23]](function(_0xd0f2x30){_0xd0f2x2f= _[_0x9edb[113]](_0xd0f2x30);var _0xd0f2x31=[];var _0xd0f2x32=_[_0x9edb[115]](_0xd0f2x2d,_0x9edb[114]);_[_0x9edb[70]](_0xd0f2x32,function(_0xd0f2x33,_0xd0f2x1f){if(_0xd0f2x1f!== _0x9edb[116]&& _0xd0f2x1f!== _0x9edb[117]){_0xd0f2x33[0][_0x9edb[120]][_0x9edb[119]][_0x9edb[71]](function(_0xd0f2x34){_0xd0f2x34[_0x9edb[118]]= _0xd0f2x16[_0x9edb[29]]});_0xd0f2x33[0][_0x9edb[120]][_0x9edb[33]]+= _0x9edb[121]+ sr({length:5});_0xd0f2x31[_0x9edb[122]](Metric[_0x9edb[101]](_0xd0f2x33[0][_0x9edb[120]][_0x9edb[56]],{include:[{model:ReportField,as:_0x9edb[119]}],transaction:_0xd0f2x2a}))}else {_0xd0f2x33[_0x9edb[71]](function(_0xd0f2x34){if(_[_0x9edb[124]](_0xd0f2x2f,_0xd0f2x34[_0x9edb[123]])|| _0xd0f2x34[_0x9edb[125]]){_0xd0f2x34[_0x9edb[118]]= _0xd0f2x16[_0x9edb[29]];_0xd0f2x31[_0x9edb[122]](ReportField[_0x9edb[101]](_0xd0f2x34,{transaction:_0xd0f2x2a}))}else {throw  new sequelize.Error(_0x9edb[126]+ _0xd0f2x34[_0x9edb[123]]+ _0x9edb[127])}})}});return _0xd0f2x31})[_0x9edb[45]]()}else {throw  new sequelize.Error(_0x9edb[129])}}}}exports[_0x9edb[101]]= function(_0xd0f2x11,_0xd0f2x12){return DefaultReport[_0x9edb[101]](_0xd0f2x11[_0x9edb[109]])[_0x9edb[23]](function(_0xd0f2x16){return _0xd0f2x12[_0x9edb[22]](201)[_0x9edb[21]](_0xd0f2x16)})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};exports[_0x9edb[130]]= function(_0xd0f2x11,_0xd0f2x12){if(_0xd0f2x11[_0x9edb[109]][_0x9edb[29]]){delete _0xd0f2x11[_0x9edb[109]][_0x9edb[29]]};return DefaultReport[_0x9edb[36]](_0xd0f2x11[_0x9edb[30]][_0x9edb[29]])[_0x9edb[23]](function(_0xd0f2x16){if(!_0xd0f2x16){return _0xd0f2x12[_0x9edb[28]](404)};var _0xd0f2x35=_[_0x9edb[131]](_0xd0f2x16,_0xd0f2x11[_0x9edb[109]]);return _0xd0f2x35[_0x9edb[132]]()})[_0x9edb[23]](function(_0xd0f2x16){return _0xd0f2x12[_0x9edb[22]](200)[_0x9edb[21]](_0xd0f2x16)})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};exports[_0x9edb[133]]= function(_0xd0f2x11,_0xd0f2x12){return DefaultReport[_0x9edb[36]](_0xd0f2x11[_0x9edb[30]][_0x9edb[29]])[_0x9edb[23]](function(_0xd0f2x16){if(!_0xd0f2x16){return _0xd0f2x12[_0x9edb[28]](404)};return _0xd0f2x16[_0x9edb[133]]()})[_0x9edb[23]](function(){return _0xd0f2x12[_0x9edb[28]](204)})[_0x9edb[20]](function(_0xd0f2x14){return handleError(_0xd0f2x12,_0xd0f2x14)})};function handleError(_0xd0f2x12,_0xd0f2x14){logger[_0x9edb[42]](_0xd0f2x14[_0x9edb[41]]);return _0xd0f2x12[_0x9edb[22]](500)[_0x9edb[21]](_0xd0f2x14)}