Built motion from commit a61a4a20.|2.5.46
[motion2.git] / server / components / import / cm / csv.js
index 897a3d7..d6e6310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44f3=['ioredis','../../../mysqldb','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','map','message','join','hasOwnProperty','data','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','length','duplicate','Duplicate\x20Contact','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','into','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','where','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','insert','cm_hopper','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','str','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','id\x20IN\x20?','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','sequelize','query','VoiceQueueId','all','BlackLists','Campaign','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse'];(function(_0x1bc600,_0x294439){var _0x54ea70=function(_0x3916c3){while(--_0x3916c3){_0x1bc600['push'](_0x1bc600['shift']());}};_0x54ea70(++_0x294439);}(_0x44f3,0x69));var _0x344f=function(_0x4a9a92,_0x1af2f5){_0x4a9a92=_0x4a9a92-0x0;var _0x38d651=_0x44f3[_0x4a9a92];return _0x38d651;};'use strict';var BPromise=require(_0x344f('0x0'));var util=require(_0x344f('0x1'));var _=require(_0x344f('0x2'));var fs=require('fs');var squel=require(_0x344f('0x3'));var Papa=require(_0x344f('0x4'));var Redis=require(_0x344f('0x5'));var db=require(_0x344f('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x344f('0x7'));config[_0x344f('0x8')]=_[_0x344f('0x9')](config[_0x344f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x344f('0xa'))(new Redis(config[_0x344f('0x8')]));require(_0x344f('0xb'))[_0x344f('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x344f('0xd')][0x2]===_0x344f('0xe')||process['argv'][0x2]===_0x344f('0xf')){throw new Error(_0x344f('0x10'));}var FILEPATH=process[_0x344f('0xd')][0x2];if(!process[_0x344f('0xd')][0x3]||process[_0x344f('0xd')][0x3]===_0x344f('0xe')||process['argv'][0x3]===_0x344f('0xf')||!process[_0x344f('0xd')][0x4]||process[_0x344f('0xd')][0x4]===_0x344f('0xe')||process['argv'][0x4]===_0x344f('0xf')){throw new Error(_0x344f('0x11'));}var FIELDS=_[_0x344f('0x12')](process[_0x344f('0xd')][0x3]['split'](','),process[_0x344f('0xd')][0x4][_0x344f('0x13')](','));if(!process[_0x344f('0xd')][0x5]||process[_0x344f('0xd')][0x5]===_0x344f('0xe')||process[_0x344f('0xd')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x344f('0xd')][0x5];var COMPANYID=process[_0x344f('0xd')][0x6]&&process['argv'][0x6]!==_0x344f('0xe')&&process[_0x344f('0xd')][0x6]!==_0x344f('0xf')?process[_0x344f('0xd')][0x6]:null;var DUPLICATES=process[_0x344f('0xd')][0x7]&&process[_0x344f('0xd')][0x7]!==_0x344f('0xe')&&process[_0x344f('0xd')][0x7]!==_0x344f('0xf')?process[_0x344f('0xd')][0x7]:null;if(!process[_0x344f('0xd')][0x8]||process[_0x344f('0xd')][0x8]==='undefined'||process[_0x344f('0xd')][0x8]===_0x344f('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x344f('0xd')][0x8];}catch(_0x5440fe){logger[_0x344f('0x14')](_0x5440fe);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x1c0caa,_0x1b9ae6,_0x15fc70,_0x272ebb){var _0x1d9ece={'message':_0x1b9ae6};_0x1d9ece[_0x1c0caa]=!![];if(_0x15fc70){_0x1d9ece['contact']=_0x15fc70;}if(_0x272ebb){_0x1d9ece[_0x344f('0x15')]=_0x272ebb;}return _0x1d9ece;}function isEmail(_0x265fee){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x344f('0x16')](_0x265fee);}function checkRow(_0x159f22,_0x27d890,_0x1569ea){return new BPromise(function(_0x2288f9,_0x1fc67e){if(_[_0x344f('0x17')](_0x159f22)){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x18'),null,_0x1569ea));}if(_0x159f22[_0x344f('0x19')]&&_0x159f22['errors']['length']){var _0x2de0c2=_[_0x344f('0x1a')](_0x159f22[_0x344f('0x19')],_0x344f('0x1b'))[_0x344f('0x1c')](';');return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x2de0c2,null,_0x1569ea));}var _0x250a47={};for(var _0x290a49 in FIELDS){if(FIELDS[_0x344f('0x1d')](_0x290a49)&&FIELDS[_0x290a49]){_0x250a47[_0x290a49]=_0x159f22[_0x344f('0x1e')][0x0][FIELDS[_0x290a49]]||_0x159f22[_0x344f('0x1e')][0x0]['\ufeff'+FIELDS[_0x290a49]];}}if(!_0x250a47['firstName']){return _0x1fc67e(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x1569ea));}if(!_0x250a47[_0x344f('0x1f')]){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x20'),null,_0x1569ea));}if(_0x250a47[_0x344f('0x21')]){var _0x2ca8a7=moment(_0x250a47['birthDate'],'YYYY-MM-DD');if(!_0x2ca8a7[_0x344f('0x22')]()){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x23'),null,_0x1569ea));}}if(_0x250a47['email']){if(!isEmail(_0x250a47[_0x344f('0x24')])){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x25'),null,_0x1569ea));}}_0x250a47[_0x344f('0x26')]=LISTID;_0x250a47['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x344f('0x27')]&&_0x27d890){var _0x194911={};for(var _0x3d127a=0x0,_0x2cf070=DUPLICATES[_0x344f('0x27')];_0x3d127a<_0x2cf070;_0x3d127a+=0x1){_0x194911[DUPLICATES[_0x3d127a]]=_0x250a47[DUPLICATES[_0x3d127a]];}var _0x349017=_['find'](_0x27d890,_0x194911);if(_0x349017){return _0x1fc67e(handleCheckRowError(_0x344f('0x28'),_0x344f('0x29'),_0x349017,_0x1569ea));}}return db['CmContact']['create'](_0x250a47,{'raw':!![],'hooks':![],'fields':_[_0x344f('0x2a')](_0x250a47)})[_0x344f('0x2b')](function(_0x27b83f){if(DUPLICATES&&DUPLICATES[_0x344f('0x27')]&&_0x27d890){_0x27d890[_0x344f('0x2c')](_[_0x344f('0x2d')](_0x250a47,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x27b83f['id'];return _0x2288f9();})[_0x344f('0x2e')](function(_0x248415){return _0x1fc67e(handleCheckRowError(_0x344f('0x14'),_0x344f('0x2f')+(_0x248415['message']||JSON[_0x344f('0x30')](_0x248415)),null,_0x1569ea));});});}function checkHopper(){function _0x3df324(){return function(_0x35b844){logger['error'](_0x344f('0x31'),'checkHopper',util[_0x344f('0x32')](_0x35b844,{'showHidden':![],'depth':null}));};}var _0x617947=function(_0x512c26,_0x38a46c){var _0x411165=squel['insert']()[_0x344f('0x33')]('cm_hopper')[_0x344f('0x34')]([_0x344f('0x1f'),_0x344f('0x35'),_0x344f('0x36'),'ListId',_0x38a46c,_0x344f('0x37'),_0x344f('0x38')],squel[_0x344f('0x39')]()[_0x344f('0x3a')](_0x344f('0x1f'),'phone')['field'](_0x344f('0x3b'),_0x344f('0x35'))[_0x344f('0x3a')]('id',_0x344f('0x36'))[_0x344f('0x3a')](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))['field'](_0x512c26['id']['toString'](),_0x38a46c)['field'](_0x344f('0x3b'),_0x344f('0x37'))[_0x344f('0x3a')](_0x344f('0x3b'),_0x344f('0x38'))[_0x344f('0x3d')]('cm_contacts')[_0x344f('0x3e')]('deletedAt\x20IS\x20NULL')[_0x344f('0x3e')]('ListId\x20=\x20?',LISTID[_0x344f('0x3c')]())[_0x344f('0x3e')](_0x344f('0x3f'))[_0x344f('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x344f('0x39')]()[_0x344f('0x3a')](_0x344f('0x1f'))[_0x344f('0x3d')]('cm_hopper')[_0x344f('0x3e')](_0x38a46c+_0x344f('0x40'),_0x512c26['id'][_0x344f('0x3c')]())))[_0x344f('0x3c')]();return _0x411165;};var _0x552f64=function(_0x1afa63,_0x339647){var _0x807ea1=squel[_0x344f('0x41')]()[_0x344f('0x33')](_0x344f('0x42'))['fromQuery']([_0x344f('0x1f'),_0x344f('0x35'),'ContactId',_0x344f('0x26'),_0x339647,_0x344f('0x37'),'updatedAt'],squel[_0x344f('0x39')]()[_0x344f('0x3a')](_0x344f('0x1f'),_0x344f('0x1f'))[_0x344f('0x3a')](_0x344f('0x3b'),_0x344f('0x35'))[_0x344f('0x3a')]('id',_0x344f('0x36'))[_0x344f('0x3a')](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))[_0x344f('0x3a')](_0x1afa63['id'][_0x344f('0x3c')](),_0x339647)['field'](_0x344f('0x3b'),_0x344f('0x37'))['field'](_0x344f('0x3b'),_0x344f('0x38'))['from'](_0x344f('0x43'))[_0x344f('0x3e')](_0x344f('0x44'))['where'](_0x344f('0x45'),LISTID[_0x344f('0x3c')]())[_0x344f('0x3e')]('id\x20IN\x20?',squel[_0x344f('0x46')](hopperContacts))[_0x344f('0x3e')](_0x344f('0x3f'))[_0x344f('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x344f('0x39')]()['field'](_0x344f('0x47'))['from'](_0x344f('0x48'))[_0x344f('0x3e')](_0x339647+_0x344f('0x40'),_0x1afa63['id'][_0x344f('0x3c')]()))['where'](_0x344f('0x49'),squel['select']()[_0x344f('0x3a')](_0x344f('0x1f'))[_0x344f('0x3d')](_0x344f('0x42'))['where'](_0x339647+_0x344f('0x40'),_0x1afa63['id'][_0x344f('0x3c')]())))[_0x344f('0x3c')]();return _0x807ea1;};function _0x224759(_0x5eddcd,_0x5e3b00){var _0x192338=squel[_0x344f('0x41')]()[_0x344f('0x33')]('cm_hopper')['fromQuery']([_0x344f('0x1f'),_0x344f('0x35'),_0x344f('0x36'),_0x344f('0x26'),_0x5e3b00,_0x344f('0x37'),'updatedAt'],squel['select']()[_0x344f('0x3a')]('phone',_0x344f('0x1f'))[_0x344f('0x3a')](_0x344f('0x3b'),'scheduledAt')[_0x344f('0x3a')]('id',_0x344f('0x36'))['field'](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))[_0x344f('0x3a')](_0x5eddcd['id'][_0x344f('0x3c')](),_0x5e3b00)[_0x344f('0x3a')]('NOW()',_0x344f('0x37'))[_0x344f('0x3a')](_0x344f('0x3b'),'updatedAt')[_0x344f('0x3d')](_0x344f('0x43'))[_0x344f('0x3e')](_0x344f('0x44'))[_0x344f('0x3e')]('ListId\x20=\x20?',LISTID['toString']())[_0x344f('0x3e')]('id\x20IN\x20?',squel[_0x344f('0x46')](hopperContacts))['where'](_0x344f('0x3f')))[_0x344f('0x3c')]();return _0x192338;}function _0x38b5dd(_0x3fe958,_0x426c01){var _0x4c10e7=squel[_0x344f('0x41')]()[_0x344f('0x33')](_0x344f('0x4a'))['fromQuery']([_0x344f('0x1f'),'ContactId',_0x344f('0x26'),_0x426c01,'createdAt',_0x344f('0x38')],squel['select']()[_0x344f('0x3a')](_0x344f('0x1f'),'phone')[_0x344f('0x3a')]('id',_0x344f('0x36'))[_0x344f('0x3a')](LISTID[_0x344f('0x3c')](),_0x344f('0x26'))[_0x344f('0x3a')](_0x3fe958['id'][_0x344f('0x3c')](),_0x426c01)[_0x344f('0x3a')]('NOW()',_0x344f('0x37'))['field'](_0x344f('0x3b'),_0x344f('0x38'))[_0x344f('0x3d')](_0x344f('0x43'))[_0x344f('0x3e')](_0x344f('0x44'))[_0x344f('0x3e')](_0x344f('0x45'),LISTID[_0x344f('0x3c')]())[_0x344f('0x3e')](_0x344f('0x4b'),squel[_0x344f('0x46')](hopperContacts))[_0x344f('0x3e')](_0x344f('0x3f')))[_0x344f('0x3c')]();return _0x4c10e7;}return db[_0x344f('0x4c')][_0x344f('0x4d')]({'where':{'type':_0x344f('0x4e')},'attributes':['id',_0x344f('0x4f')],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x51'),'where':{'id':LISTID}}]})[_0x344f('0x2b')](function(_0x4e9e6a){var _0x4461d8=[];if(_0x4e9e6a){var _0x35b177;for(var _0x5d805d=0x0,_0x540593;_0x5d805d<_0x4e9e6a['length'];_0x5d805d+=0x1){_0x540593=_0x4e9e6a[_0x5d805d][_0x344f('0x52')]({'plain':!![]});switch(_0x540593[_0x344f('0x4f')]){case'always':_0x4461d8['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x552f64(_0x540593,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));break;case'onlyIfOpen':_0x4461d8[_0x344f('0x2c')](db[_0x344f('0x53')][_0x344f('0x54')](_0x617947(_0x540593,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));break;default:_0x4461d8['push'](db['sequelize'][_0x344f('0x54')](_0x224759(_0x540593,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));}}}return _0x4461d8;})[_0x344f('0x56')]()[_0x344f('0x2b')](function(){return db['VoiceQueue'][_0x344f('0x4d')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x57'),'where':{'id':LISTID}}]})[_0x344f('0x2b')](function(_0x3bf9ae){var _0x5a4b8=[];if(_0x3bf9ae){var _0x1802da;for(var _0x4b933e=0x0,_0x23428d;_0x4b933e<_0x3bf9ae[_0x344f('0x27')];_0x4b933e+=0x1){_0x23428d=_0x3bf9ae[_0x4b933e]['get']({'plain':!![]});_0x5a4b8[_0x344f('0x2c')](db[_0x344f('0x53')][_0x344f('0x54')](_0x38b5dd(_0x23428d,_0x344f('0x55')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));}}return _0x5a4b8;})[_0x344f('0x56')]();})[_0x344f('0x2b')](function(){return db[_0x344f('0x58')][_0x344f('0x4d')]({'attributes':['id',_0x344f('0x4f')],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x51'),'where':{'id':LISTID}}]})['then'](function(_0x2b8977){var _0x30511d=[];if(_0x2b8977){for(var _0x323347=0x0,_0x3facda;_0x323347<_0x2b8977[_0x344f('0x27')];_0x323347+=0x1){_0x3facda=_0x2b8977[_0x323347]['get']({'plain':!![]});switch(_0x3facda[_0x344f('0x4f')]){case _0x344f('0x59'):_0x30511d[_0x344f('0x2c')](db['sequelize'][_0x344f('0x54')](_0x552f64(_0x3facda,_0x344f('0x5a')))[_0x344f('0x2b')](function(){})[_0x344f('0x2e')](_0x3df324()));break;case _0x344f('0x5b'):_0x30511d['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x617947(_0x3facda,'CampaignId'))['then'](function(){})[_0x344f('0x2e')](_0x3df324()));break;default:_0x30511d['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x224759(_0x3facda,_0x344f('0x5a')))['then'](function(){})[_0x344f('0x2e')](_0x3df324()));}}}return _0x30511d;})[_0x344f('0x56')]();})[_0x344f('0x2b')](function(){return db[_0x344f('0x58')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x344f('0x50')],'as':_0x344f('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x83ee2){var _0x1c1100=[];if(_0x83ee2){for(var _0x294789=0x0,_0xea36cd;_0x294789<_0x83ee2[_0x344f('0x27')];_0x294789+=0x1){_0xea36cd=_0x83ee2[_0x294789][_0x344f('0x52')]({'plain':!![]});_0x1c1100['push'](db[_0x344f('0x53')][_0x344f('0x54')](_0x38b5dd(_0xea36cd,_0x344f('0x5a')))['then'](function(){})[_0x344f('0x2e')](_0x3df324()));}}return _0x1c1100;})['all']();})[_0x344f('0x2e')](function(_0x93e081){logger[_0x344f('0x14')](_0x344f('0x5c'),_0x344f('0x5d'),_0x93e081[_0x344f('0x1b')]);});}var processPromises=function(_0x4bf66b){return BPromise[_0x344f('0x56')](promises)[_0x344f('0x2b')](function(_0xfda9cd){})['catch'](function(_0x2bf7ad){logger[_0x344f('0x14')]('Error\x20processing\x20rows\x20block:',JSON[_0x344f('0x30')](_0x2bf7ad));})[_0x344f('0x5e')](function(){socket[_0x344f('0x5f')](_0x344f('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bf66b){return _0x4bf66b[_0x344f('0x61')]();}});};var endCsv=function(){return BPromise[_0x344f('0x62')]()[_0x344f('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0x344f('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x344f('0x63')](FILEPATH);}catch(_0x3963ad){logger[_0x344f('0x14')](_0x344f('0x64'),JSON[_0x344f('0x30')](_0x3963ad));}finally{process[_0x344f('0x65')](0x0);}});};process['on']('SIGINT',function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x344f('0x62')]()[_0x344f('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x344f('0x13')](',');return db[_0x344f('0x66')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x344f('0x2b')](function(_0xf87f56){var _0x5be281=fs[_0x344f('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x344f('0x68')](_0x5be281,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1c8f95,_0x5218a3){total+=0x1;var _0x3a464d=total;promises[_0x344f('0x2c')](checkRow(_0x1c8f95,_0xf87f56,_0x3a464d)[_0x344f('0x2b')](function(){success+=0x1;})[_0x344f('0x2e')](function(_0x2b98cc){if(_0x2b98cc[_0x344f('0x14')]){errors+=0x1;delete _0x2b98cc[_0x344f('0x14')];}else if(_0x2b98cc[_0x344f('0x28')]){duplicates+=0x1;delete _0x2b98cc[_0x344f('0x28')];}rows[_0x344f('0x2c')](_0x2b98cc);}));if(total%0xc8===0x0){_0x5218a3[_0x344f('0x69')]();return processPromises(_0x5218a3);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x344f('0x6a'));endCsv();});},'error':function(_0x5625ca,_0x5420a7){logger[_0x344f('0x6b')](_0x344f('0x6c'),JSON['stringify'](_0x5625ca));endCsv();}});})[_0x344f('0x2e')](function(_0x31684b){logger[_0x344f('0x14')](_0x344f('0x6d'),JSON[_0x344f('0x30')](_0x31684b));});}main();
\ No newline at end of file
+var _0x900a=['firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','then','push','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','phone','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','fromQuery','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','cm_hopper_final','ListId\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','Lists','get','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','CmList','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','createReadStream','duplicate','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','error','errors','length','map','message','join','hasOwnProperty','data','firstName'];(function(_0x1d66e3,_0x25c782){var _0x1adf28=function(_0x3a9dc4){while(--_0x3a9dc4){_0x1d66e3['push'](_0x1d66e3['shift']());}};_0x1adf28(++_0x25c782);}(_0x900a,0xbb));var _0xa900=function(_0x899da3,_0x14c0c8){_0x899da3=_0x899da3-0x0;var _0x4008e4=_0x900a[_0x899da3];return _0x4008e4;};'use strict';var BPromise=require(_0xa900('0x0'));var util=require('util');var _=require(_0xa900('0x1'));var fs=require('fs');var squel=require(_0xa900('0x2'));var Papa=require(_0xa900('0x3'));var Redis=require(_0xa900('0x4'));var db=require(_0xa900('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xa900('0x6'))(_0xa900('0x7'));config[_0xa900('0x8')]=_[_0xa900('0x9')](config[_0xa900('0x8')],{'host':_0xa900('0xa'),'port':0x18eb});var socket=require(_0xa900('0xb'))(new Redis(config[_0xa900('0x8')]));require(_0xa900('0xc'))[_0xa900('0xd')](socket);try{if(!process[_0xa900('0xe')][0x2]||process[_0xa900('0xe')][0x2]===_0xa900('0xf')||process['argv'][0x2]==='null'){throw new Error(_0xa900('0x10'));}var FILEPATH=process[_0xa900('0xe')][0x2];if(!process[_0xa900('0xe')][0x3]||process[_0xa900('0xe')][0x3]===_0xa900('0xf')||process[_0xa900('0xe')][0x3]==='null'||!process[_0xa900('0xe')][0x4]||process[_0xa900('0xe')][0x4]===_0xa900('0xf')||process[_0xa900('0xe')][0x4]===_0xa900('0x11')){throw new Error(_0xa900('0x12'));}var FIELDS=_[_0xa900('0x13')](process['argv'][0x3][_0xa900('0x14')](','),process[_0xa900('0xe')][0x4][_0xa900('0x14')](','));if(!process['argv'][0x5]||process[_0xa900('0xe')][0x5]==='undefined'||process['argv'][0x5]==='null'){throw new Error(_0xa900('0x15'));}var LISTID=process[_0xa900('0xe')][0x5];var COMPANYID=process[_0xa900('0xe')][0x6]&&process[_0xa900('0xe')][0x6]!==_0xa900('0xf')&&process['argv'][0x6]!=='null'?process[_0xa900('0xe')][0x6]:null;var DUPLICATES=process[_0xa900('0xe')][0x7]&&process[_0xa900('0xe')][0x7]!==_0xa900('0xf')&&process[_0xa900('0xe')][0x7]!==_0xa900('0x11')?process[_0xa900('0xe')][0x7]:null;if(!process[_0xa900('0xe')][0x8]||process[_0xa900('0xe')][0x8]===_0xa900('0xf')||process[_0xa900('0xe')][0x8]==='null'){throw new Error(_0xa900('0x16'));}var SOCKET_TIMESTAMP=process[_0xa900('0xe')][0x8];}catch(_0x4df234){logger['error'](_0x4df234);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x18a525,_0xce7bf7,_0x3e0388,_0x239929){var _0x337241={'message':_0xce7bf7};_0x337241[_0x18a525]=!![];if(_0x3e0388){_0x337241[_0xa900('0x17')]=_0x3e0388;}if(_0x239929){_0x337241[_0xa900('0x18')]=_0x239929;}return _0x337241;}function isEmail(_0x5cb90b){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xa900('0x19')](_0x5cb90b);}function checkRow(_0x34458a,_0x4f6936,_0x55858a){return new BPromise(function(_0x38ada2,_0x5e8dae){if(_['isNil'](_0x34458a)){return _0x5e8dae(handleCheckRowError(_0xa900('0x1a'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x55858a));}if(_0x34458a['errors']&&_0x34458a[_0xa900('0x1b')][_0xa900('0x1c')]){var _0x11d261=_[_0xa900('0x1d')](_0x34458a[_0xa900('0x1b')],_0xa900('0x1e'))[_0xa900('0x1f')](';');return _0x5e8dae(handleCheckRowError(_0xa900('0x1a'),_0x11d261,null,_0x55858a));}var _0x2bfd52={};for(var _0x11d1cd in FIELDS){if(FIELDS[_0xa900('0x20')](_0x11d1cd)&&FIELDS[_0x11d1cd]){_0x2bfd52[_0x11d1cd]=_0x34458a[_0xa900('0x21')][0x0][FIELDS[_0x11d1cd]]||_0x34458a['data'][0x0]['\ufeff'+FIELDS[_0x11d1cd]];}}if(!_0x2bfd52[_0xa900('0x22')]){return _0x5e8dae(handleCheckRowError(_0xa900('0x1a'),_0xa900('0x23'),null,_0x55858a));}if(!_0x2bfd52['phone']){return _0x5e8dae(handleCheckRowError(_0xa900('0x1a'),'phone\x20not\x20specified!',null,_0x55858a));}if(_0x2bfd52[_0xa900('0x24')]){var _0x46ffe4=moment(_0x2bfd52['birthDate'],_0xa900('0x25'));if(!_0x46ffe4[_0xa900('0x26')]()){return _0x5e8dae(handleCheckRowError(_0xa900('0x1a'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x55858a));}}if(_0x2bfd52[_0xa900('0x27')]){if(!isEmail(_0x2bfd52[_0xa900('0x27')])){return _0x5e8dae(handleCheckRowError(_0xa900('0x1a'),_0xa900('0x28'),null,_0x55858a));}}_0x2bfd52[_0xa900('0x29')]=LISTID;_0x2bfd52[_0xa900('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xa900('0x1c')]&&_0x4f6936){var _0x430fdc={};for(var _0x2ab707=0x0,_0x2aa43c=DUPLICATES[_0xa900('0x1c')];_0x2ab707<_0x2aa43c;_0x2ab707+=0x1){_0x430fdc[DUPLICATES[_0x2ab707]]=_0x2bfd52[DUPLICATES[_0x2ab707]];}var _0x42e01b=_[_0xa900('0x2b')](_0x4f6936,_0x430fdc);if(_0x42e01b){return _0x5e8dae(handleCheckRowError('duplicate',_0xa900('0x2c'),_0x42e01b,_0x55858a));}}return db[_0xa900('0x2d')][_0xa900('0x2e')](_0x2bfd52,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2bfd52)})[_0xa900('0x2f')](function(_0x2101c6){if(DUPLICATES&&DUPLICATES[_0xa900('0x1c')]&&_0x4f6936){_0x4f6936[_0xa900('0x30')](_['pick'](_0x2bfd52,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x2101c6['id'];return _0x38ada2();})[_0xa900('0x31')](function(_0x494990){return _0x5e8dae(handleCheckRowError(_0xa900('0x1a'),_0xa900('0x32')+(_0x494990[_0xa900('0x1e')]||JSON[_0xa900('0x33')](_0x494990)),null,_0x55858a));});});}function checkHopper(){function _0xb740b(){return function(_0x44d7f1){logger[_0xa900('0x1a')](_0xa900('0x34'),_0xa900('0x35'),util[_0xa900('0x36')](_0x44d7f1,{'showHidden':![],'depth':null}));};}var _0xaef99c=function(_0x522f3c,_0x1e1d37){var _0x3fc6b6=squel[_0xa900('0x37')]()[_0xa900('0x38')](_0xa900('0x39'))['fromQuery']([_0xa900('0x3a'),_0xa900('0x3b'),_0xa900('0x3c'),_0xa900('0x29'),_0x1e1d37,'createdAt',_0xa900('0x3d')],squel[_0xa900('0x3e')]()[_0xa900('0x3f')](_0xa900('0x3a'),_0xa900('0x3a'))['field'](_0xa900('0x40'),'scheduledAt')[_0xa900('0x3f')]('id',_0xa900('0x3c'))[_0xa900('0x3f')](LISTID[_0xa900('0x41')](),_0xa900('0x29'))[_0xa900('0x3f')](_0x522f3c['id'][_0xa900('0x41')](),_0x1e1d37)[_0xa900('0x3f')](_0xa900('0x40'),_0xa900('0x42'))['field'](_0xa900('0x40'),_0xa900('0x3d'))[_0xa900('0x43')](_0xa900('0x44'))[_0xa900('0x45')]('deletedAt\x20IS\x20NULL')[_0xa900('0x45')]('ListId\x20=\x20?',LISTID[_0xa900('0x41')]())[_0xa900('0x45')](_0xa900('0x46'))[_0xa900('0x45')](_0xa900('0x47'),squel[_0xa900('0x3e')]()[_0xa900('0x3f')](_0xa900('0x3a'))[_0xa900('0x43')]('cm_hopper')[_0xa900('0x45')](_0x1e1d37+_0xa900('0x48'),_0x522f3c['id'][_0xa900('0x41')]())))['toString']();return _0x3fc6b6;};var _0x401ff6=function(_0x1ded61,_0x1eddab){var _0x433615=squel[_0xa900('0x37')]()[_0xa900('0x38')]('cm_hopper')[_0xa900('0x49')]([_0xa900('0x3a'),_0xa900('0x3b'),_0xa900('0x3c'),_0xa900('0x29'),_0x1eddab,_0xa900('0x42'),'updatedAt'],squel[_0xa900('0x3e')]()['field'](_0xa900('0x3a'),'phone')['field'](_0xa900('0x40'),'scheduledAt')[_0xa900('0x3f')]('id',_0xa900('0x3c'))[_0xa900('0x3f')](LISTID[_0xa900('0x41')](),_0xa900('0x29'))[_0xa900('0x3f')](_0x1ded61['id'][_0xa900('0x41')](),_0x1eddab)[_0xa900('0x3f')](_0xa900('0x40'),_0xa900('0x42'))[_0xa900('0x3f')](_0xa900('0x40'),'updatedAt')[_0xa900('0x43')](_0xa900('0x44'))[_0xa900('0x45')](_0xa900('0x4a'))[_0xa900('0x45')]('ListId\x20=\x20?',LISTID[_0xa900('0x41')]())[_0xa900('0x45')](_0xa900('0x4b'),squel[_0xa900('0x4c')](hopperContacts))[_0xa900('0x45')](_0xa900('0x46'))[_0xa900('0x45')](_0xa900('0x47'),squel[_0xa900('0x3e')]()[_0xa900('0x3f')]('calleridnum')[_0xa900('0x43')](_0xa900('0x4d'))[_0xa900('0x45')](_0x1eddab+_0xa900('0x48'),_0x1ded61['id'][_0xa900('0x41')]()))['where'](_0xa900('0x47'),squel[_0xa900('0x3e')]()['field'](_0xa900('0x3a'))['from']('cm_hopper')[_0xa900('0x45')](_0x1eddab+_0xa900('0x48'),_0x1ded61['id']['toString']())))[_0xa900('0x41')]();return _0x433615;};function _0x40d620(_0x24187a,_0x249c81){var _0x11235b=squel[_0xa900('0x37')]()[_0xa900('0x38')](_0xa900('0x39'))[_0xa900('0x49')]([_0xa900('0x3a'),_0xa900('0x3b'),_0xa900('0x3c'),'ListId',_0x249c81,'createdAt',_0xa900('0x3d')],squel[_0xa900('0x3e')]()['field'](_0xa900('0x3a'),_0xa900('0x3a'))[_0xa900('0x3f')]('NOW()','scheduledAt')['field']('id',_0xa900('0x3c'))[_0xa900('0x3f')](LISTID[_0xa900('0x41')](),_0xa900('0x29'))[_0xa900('0x3f')](_0x24187a['id'][_0xa900('0x41')](),_0x249c81)[_0xa900('0x3f')]('NOW()',_0xa900('0x42'))[_0xa900('0x3f')](_0xa900('0x40'),_0xa900('0x3d'))[_0xa900('0x43')](_0xa900('0x44'))[_0xa900('0x45')]('deletedAt\x20IS\x20NULL')[_0xa900('0x45')](_0xa900('0x4e'),LISTID[_0xa900('0x41')]())[_0xa900('0x45')](_0xa900('0x4b'),squel[_0xa900('0x4c')](hopperContacts))[_0xa900('0x45')](_0xa900('0x46')))[_0xa900('0x41')]();return _0x11235b;}function _0x5dfd08(_0x376d15,_0x3ba14a){var _0xa840c0=squel[_0xa900('0x37')]()['into'](_0xa900('0x4f'))[_0xa900('0x49')](['phone',_0xa900('0x3c'),'ListId',_0x3ba14a,_0xa900('0x42'),'updatedAt'],squel[_0xa900('0x3e')]()[_0xa900('0x3f')](_0xa900('0x3a'),_0xa900('0x3a'))[_0xa900('0x3f')]('id',_0xa900('0x3c'))[_0xa900('0x3f')](LISTID[_0xa900('0x41')](),_0xa900('0x29'))[_0xa900('0x3f')](_0x376d15['id'][_0xa900('0x41')](),_0x3ba14a)[_0xa900('0x3f')](_0xa900('0x40'),_0xa900('0x42'))[_0xa900('0x3f')](_0xa900('0x40'),_0xa900('0x3d'))[_0xa900('0x43')](_0xa900('0x44'))[_0xa900('0x45')](_0xa900('0x4a'))['where'](_0xa900('0x4e'),LISTID[_0xa900('0x41')]())[_0xa900('0x45')](_0xa900('0x4b'),squel[_0xa900('0x4c')](hopperContacts))['where'](_0xa900('0x46')))[_0xa900('0x41')]();return _0xa840c0;}return db[_0xa900('0x50')][_0xa900('0x51')]({'where':{'type':_0xa900('0x52')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0xa900('0x53'),'where':{'id':LISTID}}]})[_0xa900('0x2f')](function(_0x46a5b6){var _0xafd438=[];if(_0x46a5b6){var _0x3e3631;for(var _0x2cc2c7=0x0,_0x2437f8;_0x2cc2c7<_0x46a5b6['length'];_0x2cc2c7+=0x1){_0x2437f8=_0x46a5b6[_0x2cc2c7][_0xa900('0x54')]({'plain':!![]});switch(_0x2437f8[_0xa900('0x55')]){case _0xa900('0x56'):_0xafd438[_0xa900('0x30')](db[_0xa900('0x57')][_0xa900('0x58')](_0x401ff6(_0x2437f8,_0xa900('0x59')))[_0xa900('0x2f')](function(){})['catch'](_0xb740b()));break;case _0xa900('0x5a'):_0xafd438[_0xa900('0x30')](db[_0xa900('0x57')][_0xa900('0x58')](_0xaef99c(_0x2437f8,_0xa900('0x59')))[_0xa900('0x2f')](function(){})['catch'](_0xb740b()));break;default:_0xafd438[_0xa900('0x30')](db['sequelize'][_0xa900('0x58')](_0x40d620(_0x2437f8,_0xa900('0x59')))[_0xa900('0x2f')](function(){})['catch'](_0xb740b()));}}}return _0xafd438;})[_0xa900('0x5b')]()['then'](function(){return db[_0xa900('0x50')][_0xa900('0x51')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xa900('0x5c')],'as':_0xa900('0x5d'),'where':{'id':LISTID}}]})[_0xa900('0x2f')](function(_0x324ee9){var _0x55e545=[];if(_0x324ee9){var _0x268a83;for(var _0x3cbc11=0x0,_0x4e3e4e;_0x3cbc11<_0x324ee9['length'];_0x3cbc11+=0x1){_0x4e3e4e=_0x324ee9[_0x3cbc11][_0xa900('0x54')]({'plain':!![]});_0x55e545[_0xa900('0x30')](db[_0xa900('0x57')]['query'](_0x5dfd08(_0x4e3e4e,_0xa900('0x59')))[_0xa900('0x2f')](function(){})[_0xa900('0x31')](_0xb740b()));}}return _0x55e545;})[_0xa900('0x5b')]();})[_0xa900('0x2f')](function(){return db[_0xa900('0x5e')][_0xa900('0x51')]({'attributes':['id',_0xa900('0x55')],'include':[{'model':db[_0xa900('0x5c')],'as':'Lists','where':{'id':LISTID}}]})[_0xa900('0x2f')](function(_0x4ba3fc){var _0x1c768e=[];if(_0x4ba3fc){for(var _0x24f496=0x0,_0x4bc91b;_0x24f496<_0x4ba3fc[_0xa900('0x1c')];_0x24f496+=0x1){_0x4bc91b=_0x4ba3fc[_0x24f496][_0xa900('0x54')]({'plain':!![]});switch(_0x4bc91b[_0xa900('0x55')]){case'always':_0x1c768e[_0xa900('0x30')](db['sequelize'][_0xa900('0x58')](_0x401ff6(_0x4bc91b,_0xa900('0x5f')))[_0xa900('0x2f')](function(){})[_0xa900('0x31')](_0xb740b()));break;case _0xa900('0x5a'):_0x1c768e[_0xa900('0x30')](db[_0xa900('0x57')]['query'](_0xaef99c(_0x4bc91b,_0xa900('0x5f')))[_0xa900('0x2f')](function(){})['catch'](_0xb740b()));break;default:_0x1c768e['push'](db[_0xa900('0x57')][_0xa900('0x58')](_0x40d620(_0x4bc91b,_0xa900('0x5f')))[_0xa900('0x2f')](function(){})[_0xa900('0x31')](_0xb740b()));}}}return _0x1c768e;})[_0xa900('0x5b')]();})[_0xa900('0x2f')](function(){return db[_0xa900('0x5e')][_0xa900('0x51')]({'attributes':['id'],'include':[{'model':db[_0xa900('0x5c')],'as':_0xa900('0x5d'),'where':{'id':LISTID}}]})[_0xa900('0x2f')](function(_0x4f49f9){var _0x2f4bd4=[];if(_0x4f49f9){for(var _0x69bfb3=0x0,_0x57b445;_0x69bfb3<_0x4f49f9[_0xa900('0x1c')];_0x69bfb3+=0x1){_0x57b445=_0x4f49f9[_0x69bfb3][_0xa900('0x54')]({'plain':!![]});_0x2f4bd4[_0xa900('0x30')](db[_0xa900('0x57')]['query'](_0x5dfd08(_0x57b445,'CampaignId'))['then'](function(){})[_0xa900('0x31')](_0xb740b()));}}return _0x2f4bd4;})['all']();})['catch'](function(_0x33cfa1){logger[_0xa900('0x1a')](_0xa900('0x60'),'generalCheckHopper',_0x33cfa1[_0xa900('0x1e')]);});}var processPromises=function(_0x2219b6){return BPromise[_0xa900('0x5b')](promises)[_0xa900('0x2f')](function(_0x3f0fc5){})[_0xa900('0x31')](function(_0x172567){logger[_0xa900('0x1a')]('Error\x20processing\x20rows\x20block:',JSON[_0xa900('0x33')](_0x172567));})[_0xa900('0x61')](function(){socket[_0xa900('0x62')](_0xa900('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2219b6){return _0x2219b6[_0xa900('0x64')]();}});};var endCsv=function(){return BPromise[_0xa900('0x65')]()[_0xa900('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0xa900('0x2f')](function(){socket[_0xa900('0x62')](_0xa900('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xa900('0x66')](FILEPATH);}catch(_0x11a553){logger[_0xa900('0x1a')](_0xa900('0x67'),JSON[_0xa900('0x33')](_0x11a553));}finally{process[_0xa900('0x68')](0x0);}});};process['on'](_0xa900('0x69'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xa900('0x65')]()[_0xa900('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xa900('0x14')](',');return db[_0xa900('0x2d')][_0xa900('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xa900('0x2f')](function(_0xdf4810){var _0x7e1eb8=fs[_0xa900('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x7e1eb8,{'header':!![],'skipEmptyLines':!![],'step':function(_0x43c76c,_0x23415e){total+=0x1;var _0x159144=total;promises[_0xa900('0x30')](checkRow(_0x43c76c,_0xdf4810,_0x159144)['then'](function(){success+=0x1;})[_0xa900('0x31')](function(_0x4ca008){if(_0x4ca008['error']){errors+=0x1;delete _0x4ca008['error'];}else if(_0x4ca008[_0xa900('0x6b')]){duplicates+=0x1;delete _0x4ca008[_0xa900('0x6b')];}rows['push'](_0x4ca008);}));if(total%0xc8===0x0){_0x23415e['pause']();return processPromises(_0x23415e);}},'complete':function(){return processPromises()['then'](function(){logger[_0xa900('0x6c')](_0xa900('0x6d'));endCsv();});},'error':function(_0x1531ca,_0x1cfbad){logger[_0xa900('0x6c')]('CSV\x20parse\x20error',JSON[_0xa900('0x33')](_0x1531ca));endCsv();}});})['catch'](function(_0x2af7e3){logger[_0xa900('0x1a')](_0xa900('0x6e'),JSON['stringify'](_0x2af7e3));});}main();
\ No newline at end of file