Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / components / import / cm / csv2.js
index c3c9f11..11e6722 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa66d=['voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','then','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','.csv','includes','header',',utcOffset','writeFileSync','parse','rows','errors','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','complete','argv','server/files/tmp','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','where','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','ContactId','.CmListId','.id\x20=\x20','cm_hopper_black','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','createdAt','ListId\x20=\x20?','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','push','code','message','sequelize','query','spread','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','length','all','catch','voice_queues.dialTimezone'];(function(_0x5522d4,_0x453448){var _0x23a3f9=function(_0x1a8cbc){while(--_0x1a8cbc){_0x5522d4['push'](_0x5522d4['shift']());}};_0x23a3f9(++_0x453448);}(_0xa66d,0xeb));var _0xda66=function(_0xa6603d,_0x374178){_0xa6603d=_0xa6603d-0x0;var _0x3500d8=_0xa66d[_0xa6603d];return _0x3500d8;};'use strict';var fs=require('fs');var path=require(_0xda66('0x0'));var _=require(_0xda66('0x1'));var Papa=require(_0xda66('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xda66('0x3'));var squel=require(_0xda66('0x4'));var Redis=require(_0xda66('0x5'));var db=require(_0xda66('0x6'))['db'];var config=require(_0xda66('0x7'));var shared=require(_0xda66('0x8'));var logger=require(_0xda66('0x9'))('import');config[_0xda66('0xa')]=_[_0xda66('0xb')](config[_0xda66('0xa')],{'host':_0xda66('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xda66('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xda66('0xd')](_0xda66('0xe'));function isEmail(_0x3d7d41){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))*$/['test'](_0x3d7d41);}function selectNotIn(_0x407f96,_0x219417,_0x3c3ff8,_0x3690b5,_0x5c1238){return squel[_0xda66('0xf')]()[_0xda66('0x10')](_0xda66('0x11'))[_0xda66('0x12')](_0x3690b5)['join'](_0x219417,null,_0x219417+'.id\x20=\x20'+_0x3690b5+'.'+_0x3c3ff8)[_0xda66('0x13')](_0x3690b5+'.'+_0x3c3ff8+'\x20=\x20'+_0x407f96+'.'+_0x3c3ff8)[_0xda66('0x13')](_0x219417+'.dialCheckDuplicateType\x20IN\x20('+_0x5c1238[_0xda66('0x14')]()+')');}function insertCmHopper(_0x1aa462,_0x18c68c,_0x1e5905,_0x45c0c4,_0x2f745e){var _0x5a351b=[_0xda66('0x15'),_0xda66('0x16'),'cm_contacts.id',_0xda66('0x17'),_0x18c68c+'.'+_0x45c0c4,_0xda66('0x18'),'cm_contacts.updatedAt',_0xda66('0x19'),_0xda66('0x1a'),'\x22'+_0x2f745e+'\x22'];return squel[_0xda66('0x1b')]()[_0xda66('0x1c')](_0xda66('0x1d'))[_0xda66('0x1e')](['phone',_0xda66('0x1f'),'ContactId',_0xda66('0x20'),_0x45c0c4,'createdAt',_0xda66('0x21'),_0xda66('0x22'),_0xda66('0x23'),_0xda66('0x24')],squel[_0xda66('0xf')]()[_0xda66('0x25')](_0x5a351b)[_0xda66('0x12')](_0x18c68c)['join'](_0xda66('0x26'),null,_0xda66('0x27')+_0x18c68c+'.CmListId')['join'](_0x1e5905,null,_0x1e5905+'.id\x20=\x20'+_0x18c68c+'.'+_0x45c0c4)[_0xda66('0x13')](_0x18c68c+_0xda66('0x28'),_0x1aa462)['where'](_0xda66('0x29'),NOW)['where'](_0xda66('0x2a'),selectNotIn(_0x18c68c,_0x1e5905,_0x45c0c4,'cm_hopper',[_0xda66('0x2b'),_0xda66('0x2c')]))[_0xda66('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x18c68c,_0x1e5905,_0x45c0c4,'cm_hopper',['\x22always\x22'])))[_0xda66('0x2d')]();}function insertCmHopperBlack(_0x304921,_0x3e4f83,_0x4f1fdd,_0x52c387){var _0x4bd851=['cm_contacts.phone',_0xda66('0x2e'),_0xda66('0x17'),_0x3e4f83+'.'+_0x52c387,_0xda66('0x18'),'cm_contacts.updatedAt'];return squel[_0xda66('0x1b')]()[_0xda66('0x1c')]('cm_hopper_black')[_0xda66('0x1e')]([_0xda66('0x11'),_0xda66('0x2f'),'ListId',_0x52c387,'createdAt',_0xda66('0x21')],squel[_0xda66('0xf')]()[_0xda66('0x25')](_0x4bd851)[_0xda66('0x12')](_0x3e4f83)['join']('cm_contacts',null,_0xda66('0x27')+_0x3e4f83+_0xda66('0x30'))[_0xda66('0x14')](_0x4f1fdd,null,_0x4f1fdd+_0xda66('0x31')+_0x3e4f83+'.'+_0x52c387)[_0xda66('0x13')](_0x3e4f83+_0xda66('0x28'),_0x304921)[_0xda66('0x13')](_0xda66('0x29'),NOW)[_0xda66('0x13')](_0xda66('0x2a'),squel[_0xda66('0xf')]()[_0xda66('0x10')](_0xda66('0x11'))[_0xda66('0x12')](_0xda66('0x32'))['where']('ListId\x20=\x20?',_0x304921)[_0xda66('0x13')](_0x52c387+_0xda66('0x33'),_0x3e4f83+'.'+_0x52c387)))[_0xda66('0x2d')]();}function insertTzCmHopper(_0x307873,_0x22a9ca,_0x391e17,_0x29cfcf,_0x2da5b5,_0x26dfbd){var _0xd65d4c=[_0xda66('0x15'),_0xda66('0x34')+_0x26dfbd+_0xda66('0x35'),_0xda66('0x2e'),_0xda66('0x17'),_0x22a9ca+'.'+_0x29cfcf,_0xda66('0x18'),_0xda66('0x36'),_0xda66('0x19'),_0xda66('0x1a'),'\x22'+_0x2da5b5+'\x22'];var _0x800af2=squel[_0xda66('0x1b')]()[_0xda66('0x1c')](_0xda66('0x1d'))[_0xda66('0x1e')]([_0xda66('0x11'),'scheduledat',_0xda66('0x2f'),_0xda66('0x20'),_0x29cfcf,'createdAt',_0xda66('0x21'),'priority',_0xda66('0x23'),_0xda66('0x24')],squel[_0xda66('0xf')]()[_0xda66('0x25')](_0xd65d4c)['from'](_0x22a9ca)[_0xda66('0x14')](_0xda66('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x22a9ca+_0xda66('0x30'))[_0xda66('0x14')](_0x391e17,null,_0x391e17+_0xda66('0x31')+_0x22a9ca+'.'+_0x29cfcf)[_0xda66('0x14')](_0x26dfbd,null,_0x26dfbd+_0xda66('0x31')+_0x22a9ca+'.'+_0x29cfcf)['where'](_0x22a9ca+_0xda66('0x28'),_0x307873)['where'](_0xda66('0x29'),NOW)[_0xda66('0x13')](_0xda66('0x2a'),selectNotIn(_0x22a9ca,_0x391e17,_0x29cfcf,_0xda66('0x1d'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0xda66('0x13')](_0xda66('0x2a'),selectNotIn(_0x22a9ca,_0x391e17,_0x29cfcf,_0xda66('0x1d'),[_0xda66('0x2b')])))['toString']();return _0x800af2;}function insertTzCmHopperBlack(_0x57e39b,_0x42c152,_0x17193e,_0x1cea17){var _0x2833be=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x42c152+'.'+_0x1cea17,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0xda66('0x1b')]()[_0xda66('0x1c')](_0xda66('0x32'))[_0xda66('0x1e')]([_0xda66('0x11'),_0xda66('0x2f'),_0xda66('0x20'),_0x1cea17,_0xda66('0x37'),_0xda66('0x21')],squel[_0xda66('0xf')]()['fields'](_0x2833be)['from'](_0x42c152)[_0xda66('0x14')](_0xda66('0x26'),null,_0xda66('0x27')+_0x42c152+_0xda66('0x30'))[_0xda66('0x14')](_0x17193e,null,_0x17193e+_0xda66('0x31')+_0x42c152+'.'+_0x1cea17)[_0xda66('0x13')](_0x42c152+_0xda66('0x28'),_0x57e39b)[_0xda66('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xda66('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xda66('0xf')]()[_0xda66('0x10')](_0xda66('0x11'))[_0xda66('0x12')](_0xda66('0x32'))[_0xda66('0x13')](_0xda66('0x38'),_0x57e39b)[_0xda66('0x13')](_0x1cea17+_0xda66('0x33'),_0x42c152+'.'+_0x1cea17)))[_0xda66('0x2d')]();}function insertCmContact(_0x39765a,_0x1afe28,_0x2cff05,_0x436c5f){var _0x15fa08=_['concat'](_[_0xda66('0x39')](_0x436c5f),[_0xda66('0x20'),_0xda66('0x3a'),_0xda66('0x37'),_0xda66('0x21')]);return squel[_0xda66('0x1b')]()[_0xda66('0x1c')]('cm_contacts')[_0xda66('0x1e')](_0x15fa08,squel[_0xda66('0xf')]()['fields'](_0x15fa08)['from'](_0x1afe28)[_0xda66('0x13')]('('+_0x2cff05['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xda66('0xf')]()['fields'](_0x2cff05)[_0xda66('0x12')](_0xda66('0x26'))[_0xda66('0x13')](_0xda66('0x38'),_0x39765a)[_0xda66('0x13')]('deletedAt\x20IS\x20NULL'))[_0xda66('0x13')](_0xda66('0x3b'),squel['select']()[_0xda66('0x10')](_0xda66('0x3c'),_0xda66('0x3d'))[_0xda66('0x12')](_0x1afe28)[_0xda66('0x3e')](_0x2cff05['join'](','))))['toString']();}function handleStop(){logger[_0xda66('0x3f')](_0xda66('0x40'));stopped=!![];}function handleUncaughtException(_0x1cacea){logger[_0xda66('0x41')](_0x1cacea['message']);process[_0xda66('0x42')](0x1);}function handleError(_0xc7e10b,_0x572ef6){stats['errors'][_0xda66('0x43')]({'name':_0x572ef6[_0xda66('0x44')],'message':_0x572ef6[_0xda66('0x45')],'row':_0xc7e10b});}function handleQuery(_0x842529){logger[_0xda66('0x3f')](_0x842529);return db[_0xda66('0x46')][_0xda66('0x47')](_0x842529)[_0xda66('0x48')](function(_0x20ceaf){results[_0xda66('0x43')](_0x20ceaf);})['catch'](function(_0x39995b){logger[_0xda66('0x41')](_0x39995b[_0xda66('0x45')]);});}function updateTzCampaigns(_0xbc1d58){return new Promise(function(_0x54f7c3,_0x281fa9){var _0xdcc283=squel['select']()[_0xda66('0x25')](['campaigns.id',_0xda66('0x49')])[_0xda66('0x12')](_0xda66('0x4a'))[_0xda66('0x14')](_0xda66('0x4b'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0xda66('0x4c')+_0xbc1d58);db[_0xda66('0x46')]['query'](_0xdcc283[_0xda66('0x2d')]())[_0xda66('0x48')](function(_0x3490ee){var _0x5afd93=[];for(var _0x18234f=0x0;_0x18234f<_0x3490ee[_0xda66('0x4d')];_0x18234f++){_0x5afd93['push'](getTimezoneData(_0x3490ee[_0x18234f],tmp_campaigns));}BPromise[_0xda66('0x4e')](_0x5afd93)['then'](function(){_0x54f7c3({'val':0x1});});})[_0xda66('0x4f')](function(_0x15a155){logger[_0xda66('0x41')](_0x15a155[_0xda66('0x45')]);_0x54f7c3({'val':0x0});});});}function updateTzVoiceQueues(_0x2e1138){return new Promise(function(_0x4e8255,_0x4e1937){var _0x2ec57a=squel[_0xda66('0xf')]()[_0xda66('0x25')](['voice_queues.id',_0xda66('0x50')])[_0xda66('0x12')](_0xda66('0x51'))[_0xda66('0x14')](_0xda66('0x52'),null,_0xda66('0x53'))[_0xda66('0x13')](_0xda66('0x54')+_0x2e1138);db['sequelize']['query'](_0x2ec57a[_0xda66('0x2d')]())[_0xda66('0x48')](function(_0x2d84ef){var _0x200800=[];for(var _0x55ef28=0x0;_0x55ef28<_0x2d84ef[_0xda66('0x4d')];_0x55ef28++){_0x200800['push'](getTimezoneData(_0x2d84ef[_0x55ef28],tmp_voice_queues));}BPromise[_0xda66('0x4e')](_0x200800)[_0xda66('0x55')](function(){_0x4e8255({'val':0x1});});})[_0xda66('0x4f')](function(_0x48ac14){logger[_0xda66('0x41')](_0x48ac14[_0xda66('0x45')]);_0x4e8255({'val':0x0});});});}function getTimezoneData(_0x19781e,_0x1119bb){return new Promise(function(_0x4332ff,_0x314741){var _0x59487b=shared[_0xda66('0x56')];var _0x2aa37f=_0x59487b[_0x19781e[_0xda66('0x57')]];if(_[_0xda66('0x58')](_0x2aa37f)){_0x4332ff({'ret':0x1});}else{var _0x1db818=_0x2aa37f[_0xda66('0x59')];var _0x4457f8=squel['insert']()[_0xda66('0x1c')](_0x1119bb)[_0xda66('0x5a')]('id',_0x19781e['id'])[_0xda66('0x5a')](_0xda66('0x5b'),_0x1db818)[_0xda66('0x5a')](_0xda66('0x57'),_0x19781e[_0xda66('0x57')])[_0xda66('0x2d')]();return db[_0xda66('0x46')][_0xda66('0x47')](_0x4457f8)[_0xda66('0x48')](function(_0x13411a){_0x4332ff({'ret':0x1});})[_0xda66('0x4f')](function(_0x1aa11c){logger[_0xda66('0x41')](_0x1aa11c[_0xda66('0x45')]);_0x314741({'ret':0x1});});}});}function handleTZQuery(_0x26cdd7){logger[_0xda66('0x3f')](_0x26cdd7);return db[_0xda66('0x46')][_0xda66('0x47')](_0x26cdd7)[_0xda66('0x48')](function(_0x160f7d){})[_0xda66('0x4f')](function(_0x3156ad){logger[_0xda66('0x41')](_0x3156ad[_0xda66('0x45')]);});}function main(_0x1fed52,_0x2b73ac,_0x37b50f,_0x5a60ed){logger[_0xda66('0x3f')](_0xda66('0x5c'),_0x1fed52,JSON[_0xda66('0x5d')](_0x2b73ac));process[_0xda66('0x5e')](_0xda66('0x5f'));var _0x857ed0=_0x2b73ac[_0xda66('0x60')];var _0xe0c439=_0x2b73ac[_0xda66('0x61')];var _0x3cccd3=path[_0xda66('0x14')](config[_0xda66('0x62')],'server/files/tmp',_0xe0c439+_0xda66('0x63'));hasTZ=_[_0xda66('0x39')](_0x857ed0)[_0xda66('0x64')]('dialTimezone');var _0x46caf0=_[_0xda66('0x39')](_0x857ed0)['join']();logger[_0xda66('0x3f')](_0xda66('0x65'),_0x46caf0);if(hasTZ)_0x46caf0+=_0xda66('0x66');fs[_0xda66('0x67')](_0x3cccd3,_0x46caf0+'\x0a');Papa[_0xda66('0x68')](fs['createReadStream'](_0x1fed52),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5111be,_0x247895){try{for(var _0x408bfd=0x0,_0x4561d4=[];_0x408bfd<_0x5111be['data'][_0xda66('0x4d')];_0x408bfd++){stats[_0xda66('0x69')]+=0x1;if(_0x5111be[_0xda66('0x6a')][_0x408bfd]){handleError(_0x5111be[_0xda66('0x6b')][_0x408bfd],_0x5111be[_0xda66('0x6a')][_0x408bfd]);}else{var _0x4a9101=[];for(var _0x5ed874 in _0x857ed0){if(_0x857ed0[_0xda66('0x6c')](_0x5ed874)){if(_0x5111be[_0xda66('0x6b')][_0x408bfd][_0x857ed0[_0x5ed874]]){var _0x4bde1a=_[_0xda66('0x6d')](_0x5111be[_0xda66('0x6b')][_0x408bfd][_0x857ed0[_0x5ed874]][_0xda66('0x6e')](/"/g,'\x27'));switch(_0x5ed874){case _0xda66('0x1f'):var _0x47cc49=moment(_0x4bde1a,_0xda66('0xe'),!![]);if(_0x47cc49[_0xda66('0x6f')]()){_0x4561d4[_0xda66('0x43')]('\x22'+_0x4bde1a+'\x22');}else{_0x4a9101[_0xda66('0x43')](_0xda66('0x70'));}break;case _0xda66('0x22'):var _0x35d89c=parseInt(_0x4bde1a);_0x4bde1a=_[_0xda66('0x71')](_0x35d89c)||_0x35d89c<0x0||_0x35d89c>0x4?_0x5a60ed?0x3:0x2:_0x35d89c;_0x4561d4[_0xda66('0x43')]('\x22'+_0x4bde1a+'\x22');break;case _0xda66('0x23'):var _0x9badfa=parseInt(_0x4bde1a);if(_[_0xda66('0x72')](_0x9badfa)&&_[_0xda66('0x64')](_0x37b50f,_0x9badfa)){_0x4561d4[_0xda66('0x43')]('\x22'+_0x9badfa+'\x22');}else{_0x4a9101[_0xda66('0x43')](_0xda66('0x73'));}break;case _0xda66('0x74'):if(isEmail(_0x4bde1a)){_0x4561d4[_0xda66('0x43')]('\x22'+_0x4bde1a+'\x22');}else{_0x4a9101['push'](_0xda66('0x75'));}break;case _0xda66('0x76'):var _0x5231d0=moment(_0x4bde1a,_0xda66('0x77'),!![]);if(_0x5231d0[_0xda66('0x6f')]()){_0x4561d4[_0xda66('0x43')]('\x22'+_0x4bde1a+'\x22');}else{_0x4a9101[_0xda66('0x43')](_0xda66('0x78'));}break;case'dialTimezone':var _0x4d765d=shared[_0xda66('0x56')];var _0x3063bd=_0x4d765d[_0x4bde1a];if(!_[_0xda66('0x58')](_0x3063bd)){var _0x284957=_0x3063bd[_0xda66('0x59')];_0x4561d4['push']('\x22'+_0x4bde1a+'\x22');_0x4561d4[_0xda66('0x43')]('\x22'+_0x284957+'\x22');}break;default:_0x4561d4[_0xda66('0x43')]('\x22'+_0x4bde1a+'\x22');}}else{switch(_0x5ed874){case _0xda66('0x79'):case _0xda66('0x11'):_0x4a9101['push'](_0x5ed874+_0xda66('0x7a'));break;default:_0x4561d4[_0xda66('0x43')]('\x22\x22');}}}}if(_0x4a9101['length']){handleError(_0x5111be[_0xda66('0x6b')][_0x408bfd],{'code':_0xda66('0x7b'),'message':_0x4a9101['join']()});}else{fs[_0xda66('0x7c')](_0x3cccd3,_0x4561d4['join']()+'\x0a');}_0x4561d4=[];}if(!(stats[_0xda66('0x69')]%0xc8)){socket['emit'](_0xda66('0x7d')+_0xe0c439,stats);stats[_0xda66('0x6a')]=[];}}if(stopped){logger['info'](_0xda66('0x7e'));_0x247895['abort']();}}catch(_0xf0c894){handleError(_0x5111be[_0xda66('0x6b')][_0x408bfd],{'code':_0xda66('0x7f'),'message':_0xf0c894[_0xda66('0x45')]});logger['error'](_0xda66('0x80'),_0xf0c894['message']);}},'complete':function(){try{var _0x216c2c=[];var _0x149240=[];var _0x3857a2=_0xda66('0x26');if(_0x2b73ac['duplicates']&&_0x2b73ac[_0xda66('0x81')]['length']){_0x3857a2=_0xda66('0x82')+_0xe0c439;_0x216c2c['push'](_0xda66('0x83')+_0x3857a2+_0xda66('0x84'));}tmp_campaigns=_0xda66('0x85')+_0xe0c439;tmp_voice_queues='voice_queues_'+_0xe0c439;_0x149240[_0xda66('0x43')](_0xda66('0x83')+tmp_campaigns+_0xda66('0x86'));_0x149240[_0xda66('0x43')](_0xda66('0x83')+tmp_voice_queues+_0xda66('0x86'));BPromise[_0xda66('0x87')](_0x149240,handleTZQuery)['then'](function(_0x24cae2){updateTzCampaigns(_0x2b73ac['ListId'])[_0xda66('0x55')](function(_0x33e286){updateTzVoiceQueues(_0x2b73ac[_0xda66('0x20')])['then'](function(_0x32c228){var _0x5de96c=util['format'](_0xda66('0x88'),_0x3cccd3,_0x3857a2,_0x46caf0,_0x2b73ac[_0xda66('0x20')],_0x2b73ac[_0xda66('0x3a')]||null,NOW,NOW);if(_[_0xda66('0x58')](_0x857ed0[_0xda66('0x1f')])){_0x5de96c+=_0xda66('0x89');}_0x216c2c[_0xda66('0x43')](_0x5de96c);if(_0x2b73ac[_0xda66('0x81')]&&_0x2b73ac[_0xda66('0x81')]['length']){_0x216c2c['push'](insertCmContact(_0x2b73ac[_0xda66('0x20')],_0x3857a2,_0x2b73ac[_0xda66('0x81')],_0x857ed0));_0x216c2c[_0xda66('0x43')]('DROP\x20TABLE\x20'+_0x3857a2+';');}if(hasTZ){_0x216c2c[_0xda66('0x43')](insertTzCmHopper(_0x2b73ac[_0xda66('0x20')],'voice_queues_has_cm_lists','voice_queues','VoiceQueueId',_0x5a60ed,tmp_voice_queues));_0x216c2c[_0xda66('0x43')](insertTzCmHopperBlack(_0x2b73ac[_0xda66('0x20')],_0xda66('0x8a'),_0xda66('0x51'),_0xda66('0x8b')));_0x216c2c[_0xda66('0x43')](insertTzCmHopper(_0x2b73ac[_0xda66('0x20')],_0xda66('0x4b'),_0xda66('0x4a'),'CampaignId',_0x5a60ed,tmp_campaigns));_0x216c2c['push'](insertTzCmHopperBlack(_0x2b73ac[_0xda66('0x20')],_0xda66('0x8c'),_0xda66('0x4a'),'CampaignId'));}else{_0x216c2c[_0xda66('0x43')](insertCmHopper(_0x2b73ac['ListId'],_0xda66('0x52'),'voice_queues',_0xda66('0x8b'),_0x5a60ed));_0x216c2c[_0xda66('0x43')](insertCmHopperBlack(_0x2b73ac[_0xda66('0x20')],_0xda66('0x8a'),_0xda66('0x51'),_0xda66('0x8b')));_0x216c2c[_0xda66('0x43')](insertCmHopper(_0x2b73ac[_0xda66('0x20')],'campaigns_has_cm_lists',_0xda66('0x4a'),_0xda66('0x8d'),_0x5a60ed));_0x216c2c['push'](insertCmHopperBlack(_0x2b73ac[_0xda66('0x20')],'campaigns_has_cm_blacklists',_0xda66('0x4a'),_0xda66('0x8d')));}_0x216c2c[_0xda66('0x43')](_0xda66('0x8e')+tmp_campaigns+';');_0x216c2c[_0xda66('0x43')](_0xda66('0x8e')+tmp_voice_queues+';');BPromise['each'](_0x216c2c,handleQuery)['then'](function(_0x11f111){stats[_0xda66('0x8f')]=!![];stats[_0xda66('0x90')]=_0x2b73ac['duplicates']&&_0x2b73ac['duplicates'][_0xda66('0x4d')]?results[0x2][_0xda66('0x90')]:results[0x0][_0xda66('0x90')];socket[_0xda66('0x91')]('contact:import:'+_0xe0c439,stats);fs['unlink'](_0x1fed52);fs[_0xda66('0x92')](_0x3cccd3);process[_0xda66('0x42')](0x0);})['catch'](function(_0x9eee63){logger[_0xda66('0x41')](_0x9eee63['message']);process[_0xda66('0x42')](0x1);});});});});}catch(_0x225c42){logger[_0xda66('0x41')](_0xda66('0x93'),_0x225c42[_0xda66('0x45')]);process[_0xda66('0x42')](0x1);}},'error':function(_0x32e78d,_0x56d1d0,_0x59c931,_0x5a7ebd){throw new Error(_0x5a7ebd);}});}function validate(){if(process['argv']&&process[_0xda66('0x94')][_0xda66('0x4d')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x2e4f23=path[_0xda66('0x14')](config[_0xda66('0x62')],_0xda66('0x95'),process['argv'][0x2]);if(!fs['existsSync'](_0x2e4f23)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x62aacd={};try{_0x62aacd=JSON[_0xda66('0x68')](process[_0xda66('0x94')][0x3]);if(!_0x62aacd['binding']){throw new Error(_0xda66('0x96'));}if(!_0x62aacd[_0xda66('0x60')][_0xda66('0x11')]){throw new Error(_0xda66('0x97'));}if(!_0x62aacd['binding'][_0xda66('0x79')]){throw new Error(_0xda66('0x98'));}var _0x2c56e7=0x0;if(_0x62aacd[_0xda66('0x60')][_0xda66('0x23')]){_0x2c56e7=0x1;}if(!_0x62aacd['ListId']){throw new Error(_0xda66('0x99'));}}catch(_0x1b356a){throw new Error(_0xda66('0x9a'));}var _0x4dce2e=[];try{_0x4dce2e=_['map'](JSON[_0xda66('0x68')](process[_0xda66('0x94')][0x4]),'id');}catch(_0x4b6f4f){logger[_0xda66('0x3f')](_0xda66('0x9b'));}main(_0x2e4f23,_0x62aacd,_0x4dce2e,_0x2c56e7);}validate();process['on'](_0xda66('0x9c'),handleStop);process['on'](_0xda66('0x9d'),handleUncaughtException);
\ No newline at end of file
+var _0x99f7=['firstName','itemTypeId','description','SystemRow','appendFileSync','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','CompanyId',',\x20scheduledAt\x20=\x20NOW()','orderBy','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','lodash','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','length','push','all','split','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','into','cm_hopper','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','join','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20','\x20=\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','fromQuery','scheduledat','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt','ListId\x20=\x20?','id\x20IN\x20?','min_id','info','Received\x20SIGINT','exit','errors','sequelize','spread','catch','message','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','error','voice_queues.id','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','query','timezones','dialTimezone','utcOffset','set','offset','main','send','start','binding','clone','socket_timestamp','root','.csv','header','ContactItemType','name','_description','writeFileSync','createReadStream','rows','data','find','isNil','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD'];(function(_0x2e08fe,_0x4f4b67){var _0xe83039=function(_0x3be780){while(--_0x3be780){_0x2e08fe['push'](_0x2e08fe['shift']());}};_0xe83039(++_0x4f4b67);}(_0x99f7,0xe1));var _0x799f=function(_0x186e1a,_0x59d2b8){_0x186e1a=_0x186e1a-0x0;var _0x1c2d5b=_0x99f7[_0x186e1a];return _0x1c2d5b;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x799f('0x0'));var Papa=require('papaparse');var util=require('util');var BPromise=require('bluebird');var moment=require(_0x799f('0x1'));var squel=require(_0x799f('0x2'));var Redis=require(_0x799f('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x799f('0x4'));var shared=require(_0x799f('0x5'));var logger=require(_0x799f('0x6'))(_0x799f('0x7'));config[_0x799f('0x8')]=_[_0x799f('0x9')](config[_0x799f('0x8')],{'host':_0x799f('0xa'),'port':0x18eb});var socket=require(_0x799f('0xb'))(new Redis(config[_0x799f('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x799f('0xc')](_0x799f('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x799f('0xc')](_0x799f('0xd'));function isEmail(_0x1068e9){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))*$/['test'](_0x1068e9);}function selectNotIn(_0x527787,_0x1ba2ce,_0x322b30,_0x2159ef,_0x52e2d4){return squel[_0x799f('0xe')]()[_0x799f('0xf')](_0x799f('0x10'))[_0x799f('0x11')](_0x2159ef)['join'](_0x1ba2ce,null,_0x1ba2ce+'.id\x20=\x20'+_0x2159ef+'.'+_0x322b30)[_0x799f('0x12')](_0x2159ef+'.'+_0x322b30+'\x20=\x20'+_0x527787+'.'+_0x322b30)['where'](_0x1ba2ce+_0x799f('0x13')+_0x52e2d4['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2096ac,_0x39e0fc){promisesAdditionalPhones=[];return db[_0x799f('0x14')][_0x799f('0x15')]({'raw':!![],'attributes':['id',_0x799f('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x799f('0x17')](function(_0x44efb7){if(_0x44efb7!==null){var _0x2df48c=[];for(var _0x146387=0x0;_0x146387<_0x44efb7[_0x799f('0x18')];_0x146387++){var _0x4ea6a7=_0x44efb7[_0x146387];_0x2df48c[_0x799f('0x19')](insertAdditionalPhones(_0x4ea6a7));}}Promise[_0x799f('0x1a')](_0x2df48c)[_0x799f('0x17')](function(){_0x2096ac({'val':0x1});});});});}function insertAdditionalPhones(_0x122697){return new Promise(function(_0x527659,_0x49c4de){var _0x5f2f01=_0x122697[_0x799f('0x16')];var _0x12308b=_0x5f2f01[_0x799f('0x1b')](';');var _0x2f3478=[];orderBy=0x0;for(var _0x3a8eda=0x0;_0x3a8eda<_0x12308b[_0x799f('0x18')];_0x3a8eda++){_0x2f3478[_0x799f('0x19')](splitAdditionalPhone(_0x122697['id'],_0x12308b[_0x3a8eda]));}Promise[_0x799f('0x1a')](_0x2f3478)[_0x799f('0x17')](function(){_0x527659({'val':_0x12308b[_0x799f('0x18')]});});});}function splitAdditionalPhone(_0x418968,_0x79115c){return new Promise(function(_0x4073aa,_0xb86804){var _0x5066ce=_0x79115c[_0x799f('0x1b')](':');var _0x4cf246=_0x5066ce[0x0];var _0x96fb1d=_0x5066ce[0x1];if(!_['isNil'](_0x96fb1d)){var _0x41a3ea=_0x96fb1d[_0x799f('0x1b')]('|');var _0x3e2e7a=[];for(var _0x4e9b1b=0x0;_0x4e9b1b<_0x41a3ea[_0x799f('0x18')];_0x4e9b1b++){if(_0x41a3ea[_0x4e9b1b]!==''){var _0x522772=_['filter'](promisesAdditionalPhones,{'contactId':_0x418968,'phone':_0x41a3ea[_0x4e9b1b]});if(_0x522772['length']==0x0){orderBy++;promisesAdditionalPhones[_0x799f('0x19')]({'contactId':_0x418968,'contactTypeId':_0x4cf246,'phone':_0x41a3ea[_0x4e9b1b],'orderBy':orderBy});}}}_0x4073aa({'ok':0x1});}else _0x4073aa({'res':0x0});});}function createAdditionalPhone(_0x36983a,_0x4d5629,_0x296e85,_0x3361dc){var _0x5ccbcf='';var _0x3b04ed='';var _0x1638e9=_0x296e85[_0x799f('0x1b')]('§');_0x5ccbcf=_0x1638e9[0x0];if(_0x1638e9[_0x799f('0x18')]==0x2)_0x3b04ed=_0x1638e9[0x1];return new Promise(function(_0x1df4e5,_0x5c956f){return db[_0x799f('0x1c')][_0x799f('0x1d')]({'where':{'CmContactId':_0x36983a,'item':_0x5ccbcf}})['then'](function(_0x467a52){if(_0x467a52){return db[_0x799f('0x1c')][_0x799f('0x1e')]({'ItemTypeId':_0x4d5629,'description':_0x3b04ed,'OrderBy':_0x3361dc},{'where':{'CmContactId':_0x36983a,'item':_0x5ccbcf}})[_0x799f('0x17')](function(_0x431d91){_0x1df4e5({'res':_0x799f('0x1f')});});}else{return db[_0x799f('0x1c')][_0x799f('0x20')]({'CmContactId':_0x36983a,'item':_0x5ccbcf,'description':_0x3b04ed,'ItemTypeId':_0x4d5629,'OrderBy':_0x3361dc,'ItemClass':_0x799f('0x21')})[_0x799f('0x17')](function(_0x205e1c){_0x1df4e5({'res':_0x799f('0x22')});});}});});}function insertCmHopper(_0x40ea8b,_0x57b18b,_0x3f7ebd,_0x597de8,_0x297b04){var _0x39480e=[_0x799f('0x23'),_0x799f('0x24'),_0x799f('0x25'),_0x799f('0x26'),_0x57b18b+'.'+_0x597de8,_0x799f('0x27'),'cm_contacts.updatedAt',_0x799f('0x28'),'cm_contacts.UserId','\x22'+_0x297b04+'\x22'];return squel[_0x799f('0x29')]()[_0x799f('0x2a')](_0x799f('0x2b'))['fromQuery']([_0x799f('0x10'),'scheduledat',_0x799f('0x2c'),_0x799f('0x2d'),_0x597de8,_0x799f('0x2e'),_0x799f('0x2f'),_0x799f('0x30'),_0x799f('0x31'),_0x799f('0x32')],squel[_0x799f('0xe')]()['fields'](_0x39480e)[_0x799f('0x11')](_0x57b18b)['join'](_0x799f('0x33'),null,'cm_contacts.ListId\x20=\x20'+_0x57b18b+_0x799f('0x34'))[_0x799f('0x35')](_0x3f7ebd,null,_0x3f7ebd+_0x799f('0x36')+_0x57b18b+'.'+_0x597de8)['where'](_0x57b18b+_0x799f('0x37'),_0x40ea8b)[_0x799f('0x12')](_0x799f('0x38'),NOW)[_0x799f('0x12')](_0x799f('0x39'),selectNotIn(_0x57b18b,_0x3f7ebd,_0x597de8,_0x799f('0x2b'),[_0x799f('0x3a'),_0x799f('0x3b')]))[_0x799f('0x12')](_0x799f('0x39'),selectNotIn(_0x57b18b,_0x3f7ebd,_0x597de8,'cm_hopper',['\x22always\x22'])))[_0x799f('0x3c')]();}function insertCmHopperBlack(_0x552980,_0x52eaeb,_0x464230,_0x57c4b4){var _0x42ce7a=[_0x799f('0x23'),_0x799f('0x25'),_0x799f('0x26'),_0x52eaeb+'.'+_0x57c4b4,_0x799f('0x27'),_0x799f('0x3d')];return squel['insert']()[_0x799f('0x2a')](_0x799f('0x3e'))['fromQuery']([_0x799f('0x10'),_0x799f('0x2c'),_0x799f('0x2d'),_0x57c4b4,_0x799f('0x2e'),_0x799f('0x2f')],squel[_0x799f('0xe')]()[_0x799f('0x3f')](_0x42ce7a)[_0x799f('0x11')](_0x52eaeb)[_0x799f('0x35')]('cm_contacts',null,_0x799f('0x40')+_0x52eaeb+_0x799f('0x34'))[_0x799f('0x35')](_0x464230,null,_0x464230+'.id\x20=\x20'+_0x52eaeb+'.'+_0x57c4b4)[_0x799f('0x12')](_0x52eaeb+_0x799f('0x37'),_0x552980)[_0x799f('0x12')](_0x799f('0x38'),NOW)[_0x799f('0x12')](_0x799f('0x39'),squel[_0x799f('0xe')]()['field'](_0x799f('0x10'))[_0x799f('0x11')]('cm_hopper_black')[_0x799f('0x12')]('ListId\x20=\x20?',_0x552980)[_0x799f('0x12')](_0x57c4b4+_0x799f('0x41')+_0x52eaeb+'.'+_0x57c4b4)))[_0x799f('0x3c')]();}function insertTzCmHopper(_0x20320c,_0x1aa409,_0x3abf60,_0x19b34c,_0x253d50,_0x2acb18){var _0x437341=[_0x799f('0x23'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x2acb18+_0x799f('0x42'),'cm_contacts.id','cm_contacts.ListId',_0x1aa409+'.'+_0x19b34c,_0x799f('0x27'),_0x799f('0x3d'),_0x799f('0x28'),_0x799f('0x43'),'\x22'+_0x253d50+'\x22'];var _0x11ddf0=squel['insert']()[_0x799f('0x2a')](_0x799f('0x2b'))[_0x799f('0x44')]([_0x799f('0x10'),_0x799f('0x45'),'ContactId',_0x799f('0x2d'),_0x19b34c,_0x799f('0x2e'),_0x799f('0x2f'),_0x799f('0x30'),_0x799f('0x31'),_0x799f('0x32')],squel[_0x799f('0xe')]()['fields'](_0x437341)[_0x799f('0x11')](_0x1aa409)[_0x799f('0x35')]('cm_contacts',null,_0x799f('0x40')+_0x1aa409+_0x799f('0x34'))[_0x799f('0x35')](_0x3abf60,null,_0x3abf60+_0x799f('0x36')+_0x1aa409+'.'+_0x19b34c)[_0x799f('0x35')](_0x2acb18,null,_0x2acb18+_0x799f('0x36')+_0x1aa409+'.'+_0x19b34c)[_0x799f('0x12')](_0x1aa409+_0x799f('0x37'),_0x20320c)[_0x799f('0x12')](_0x799f('0x38'),NOW)['where'](_0x799f('0x39'),selectNotIn(_0x1aa409,_0x3abf60,_0x19b34c,_0x799f('0x2b'),[_0x799f('0x3a'),_0x799f('0x3b')]))[_0x799f('0x12')](_0x799f('0x39'),selectNotIn(_0x1aa409,_0x3abf60,_0x19b34c,_0x799f('0x2b'),[_0x799f('0x3a')])))[_0x799f('0x3c')]();return _0x11ddf0;}function insertTzCmHopperBlack(_0x65b997,_0x2dbf66,_0x460fa6,_0x31e127){var _0x1938c5=[_0x799f('0x23'),_0x799f('0x25'),_0x799f('0x26'),_0x2dbf66+'.'+_0x31e127,_0x799f('0x27'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x799f('0x3e'))[_0x799f('0x44')]([_0x799f('0x10'),_0x799f('0x2c'),'ListId',_0x31e127,_0x799f('0x2e'),_0x799f('0x2f')],squel['select']()[_0x799f('0x3f')](_0x1938c5)['from'](_0x2dbf66)['join']('cm_contacts',null,_0x799f('0x40')+_0x2dbf66+_0x799f('0x34'))[_0x799f('0x35')](_0x460fa6,null,_0x460fa6+_0x799f('0x36')+_0x2dbf66+'.'+_0x31e127)[_0x799f('0x12')](_0x2dbf66+_0x799f('0x37'),_0x65b997)[_0x799f('0x12')](_0x799f('0x38'),NOW)[_0x799f('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x799f('0xe')]()[_0x799f('0xf')]('phone')[_0x799f('0x11')](_0x799f('0x3e'))['where']('ListId\x20=\x20?',_0x65b997)['where'](_0x31e127+_0x799f('0x41')+_0x2dbf66+'.'+_0x31e127)))['toString']();}function insertCmHopperAdditionalPhones(_0x36fb4e){var _0x474356=[_0x799f('0x46'),_0x799f('0x47'),'cm_contact_has_items.OrderBy',_0x799f('0x48'),'cm_contact_has_items.updatedAt'];return squel[_0x799f('0x29')]()['into'](_0x799f('0x49'))[_0x799f('0x44')]([_0x799f('0x4a'),'phone',_0x799f('0x4b'),'createdAt','updatedAt'],squel[_0x799f('0xe')]()[_0x799f('0x3f')](_0x474356)['from'](_0x799f('0x2b'))['join'](_0x799f('0x33'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x799f('0x35')]('cm_contact_has_items',null,_0x799f('0x4c'))[_0x799f('0x12')](_0x799f('0x4d'),_0x36fb4e)[_0x799f('0x12')](_0x799f('0x38'),NOW))[_0x799f('0x3c')]();}function insertCmContact(_0x3ca082,_0x3a11cf,_0x56f33b,_0x13b1fd){var _0x3e7576=_[_0x799f('0x4e')](_[_0x799f('0x4f')](_0x13b1fd),[_0x799f('0x2d'),'CompanyId','createdAt',_0x799f('0x2f'),_0x799f('0x50')]);return squel['insert']()['into']('cm_contacts')[_0x799f('0x44')](_0x3e7576,squel[_0x799f('0xe')]()[_0x799f('0x3f')](_0x3e7576)['from'](_0x3a11cf)[_0x799f('0x12')]('('+_0x56f33b['join'](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x799f('0x3f')](_0x56f33b)['from'](_0x799f('0x33'))[_0x799f('0x12')](_0x799f('0x51'),_0x3ca082)[_0x799f('0x12')]('deletedAt\x20IS\x20NULL'))['where'](_0x799f('0x52'),squel['select']()['field']('MIN(id)',_0x799f('0x53'))[_0x799f('0x11')](_0x3a11cf)['group'](_0x56f33b[_0x799f('0x35')](','))))[_0x799f('0x3c')]();}function handleStop(){logger[_0x799f('0x54')](_0x799f('0x55'));stopped=!![];}function handleUncaughtException(_0x23943d){logger['error'](_0x23943d['message']);process[_0x799f('0x56')](0x1);}function handleError(_0x59d330,_0x58e8ad){stats[_0x799f('0x57')][_0x799f('0x19')]({'name':_0x58e8ad['code'],'message':_0x58e8ad['message'],'row':_0x59d330});}function handleQuery(_0x4a1a9c){logger['info'](_0x4a1a9c);return db[_0x799f('0x58')]['query'](_0x4a1a9c)[_0x799f('0x59')](function(_0x32291c){results[_0x799f('0x19')](_0x32291c);})[_0x799f('0x5a')](function(_0x1ba40b){logger['error'](_0x1ba40b[_0x799f('0x5b')]);});}function updateTzCampaigns(_0x151332){return new Promise(function(_0x319bfe,_0x2e40c6){var _0x44c63c=squel[_0x799f('0xe')]()[_0x799f('0x3f')]([_0x799f('0x5c'),_0x799f('0x5d')])[_0x799f('0x11')](_0x799f('0x5e'))[_0x799f('0x35')](_0x799f('0x5f'),null,_0x799f('0x60'))[_0x799f('0x12')]('campaigns_has_cm_lists.CmListId='+_0x151332);db[_0x799f('0x58')]['query'](_0x44c63c[_0x799f('0x3c')]())[_0x799f('0x59')](function(_0x4600b9){var _0x2ad685=[];for(var _0xd577a0=0x0;_0xd577a0<_0x4600b9['length'];_0xd577a0++){_0x2ad685['push'](getTimezoneData(_0x4600b9[_0xd577a0],tmp_campaigns));}BPromise[_0x799f('0x1a')](_0x2ad685)[_0x799f('0x17')](function(){_0x319bfe({'val':0x1});});})[_0x799f('0x5a')](function(_0x4adae8){logger[_0x799f('0x61')](_0x4adae8['message']);_0x319bfe({'val':0x0});});});}function updateTzVoiceQueues(_0x10bf22){return new Promise(function(_0x4b0563,_0x3f41d9){var _0x55579a=squel[_0x799f('0xe')]()[_0x799f('0x3f')]([_0x799f('0x62'),'voice_queues.dialTimezone'])[_0x799f('0x11')]('voice_queues')[_0x799f('0x35')]('voice_queues_has_cm_lists',null,_0x799f('0x63'))[_0x799f('0x12')]('voice_queues_has_cm_lists.CmListId='+_0x10bf22);db[_0x799f('0x58')][_0x799f('0x64')](_0x55579a[_0x799f('0x3c')]())['spread'](function(_0x2a7fbb){var _0xf2a5a4=[];for(var _0x517a70=0x0;_0x517a70<_0x2a7fbb[_0x799f('0x18')];_0x517a70++){_0xf2a5a4[_0x799f('0x19')](getTimezoneData(_0x2a7fbb[_0x517a70],tmp_voice_queues));}BPromise[_0x799f('0x1a')](_0xf2a5a4)['then'](function(){_0x4b0563({'val':0x1});});})['catch'](function(_0x5dbaae){logger['error'](_0x5dbaae[_0x799f('0x5b')]);_0x4b0563({'val':0x0});});});}function getTimezoneData(_0x418b31,_0x5bd62c){return new Promise(function(_0x4d54aa,_0x2a88dc){var _0x391544=shared[_0x799f('0x65')];var _0xb93c7d=_0x391544[_0x418b31[_0x799f('0x66')]];if(_['isNil'](_0xb93c7d)){_0x4d54aa({'ret':0x1});}else{var _0x487162=_0xb93c7d[_0x799f('0x67')];var _0x539ce8=squel[_0x799f('0x29')]()[_0x799f('0x2a')](_0x5bd62c)[_0x799f('0x68')]('id',_0x418b31['id'])[_0x799f('0x68')](_0x799f('0x69'),_0x487162)['set'](_0x799f('0x66'),_0x418b31[_0x799f('0x66')])[_0x799f('0x3c')]();return db[_0x799f('0x58')]['query'](_0x539ce8)[_0x799f('0x59')](function(_0x4a7981){_0x4d54aa({'ret':0x1});})[_0x799f('0x5a')](function(_0x2acef4){logger[_0x799f('0x61')](_0x2acef4[_0x799f('0x5b')]);_0x2a88dc({'ret':0x1});});}});}function handleTZQuery(_0x486e01){logger[_0x799f('0x54')](_0x486e01);return db[_0x799f('0x58')]['query'](_0x486e01)['spread'](function(_0x43752e){})[_0x799f('0x5a')](function(_0x246c7e){logger[_0x799f('0x61')](_0x246c7e[_0x799f('0x5b')]);});}function main(_0x59d87c,_0x1505dc,_0x465057,_0x21f8ce){logger['info'](_0x799f('0x6a'),_0x59d87c,JSON['stringify'](_0x1505dc));process[_0x799f('0x6b')](_0x799f('0x6c'));var _0x40e1bd=_0x1505dc[_0x799f('0x6d')];var _0x2ac3ab=_[_0x799f('0x6e')](_0x40e1bd);var _0x1ff895=_0x1505dc[_0x799f('0x6f')];var _0x540a49=path['join'](config[_0x799f('0x70')],'server/files/tmp',_0x1ff895+_0x799f('0x71'));hasTZ=_[_0x799f('0x4f')](_0x40e1bd)['includes'](_0x799f('0x66'));var _0xb5a1b1=_[_0x799f('0x4f')](_0x40e1bd)[_0x799f('0x35')]();logger[_0x799f('0x54')](_0x799f('0x72'),_0xb5a1b1);db[_0x799f('0x73')]['findAll']({'raw':!![],'attributes':['id',_0x799f('0x74')]})[_0x799f('0x17')](function(_0x23ab5c){for(var _0x398ad4=0x0;_0x398ad4<_0x23ab5c['length'];_0x398ad4++){if(_0x23ab5c[_0x398ad4][_0x799f('0x74')]in _0x40e1bd){contactItemTypes[_0x799f('0x19')](_0x23ab5c[_0x398ad4]);delete _0x2ac3ab[_0x23ab5c[_0x398ad4][_0x799f('0x74')]];hasAdditionalPhones=!![];}for(var _0x5b50c6 in _0x40e1bd){if(_0x23ab5c[_0x398ad4][_0x799f('0x74')]+_0x799f('0x75')===_0x5b50c6){phoneDescriptions[_0x799f('0x19')]({'itemTypeId':_0x23ab5c[_0x398ad4]['id'],'description':_0x5b50c6});delete _0x2ac3ab[_0x5b50c6];}}}if(hasAdditionalPhones)_0x2ac3ab[_0x799f('0x16')]='';var _0x37ffd3=_[_0x799f('0x4f')](_0x2ac3ab)[_0x799f('0x35')]();logger[_0x799f('0x54')](_0x799f('0x72'),_0x37ffd3);fs[_0x799f('0x76')](_0x540a49,_0x37ffd3+'\x0a');Papa['parse'](fs[_0x799f('0x77')](_0x59d87c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x160519,_0x3f121a){try{for(var _0x4688d3=0x0,_0x381113=[];_0x4688d3<_0x160519['data'][_0x799f('0x18')];_0x4688d3++){stats[_0x799f('0x78')]+=0x1;if(_0x160519[_0x799f('0x57')][_0x4688d3]){handleError(_0x160519[_0x799f('0x79')][_0x4688d3],_0x160519[_0x799f('0x57')][_0x4688d3]);}else{var _0xe8036b=[];var _0x85f3e8=[];var _0x8cc6cd={};for(var _0x19df7a in _0x40e1bd){let _0x3cbca6=contactItemTypes[_0x799f('0x7a')](_0x390cf2=>_0x390cf2[_0x799f('0x74')]===_0x19df7a);let _0x17a231=contactItemTypes[_0x799f('0x7a')](_0x2d3c3a=>_0x2d3c3a[_0x799f('0x74')]+_0x799f('0x75')===_0x19df7a);if(_[_0x799f('0x7b')](_0x3cbca6)&&_['isNil'](_0x17a231)){if(_0x40e1bd[_0x799f('0x7c')](_0x19df7a)){if(_0x160519[_0x799f('0x79')][_0x4688d3][_0x40e1bd[_0x19df7a]]){var _0x585996=_[_0x799f('0x7d')](_0x160519[_0x799f('0x79')][_0x4688d3][_0x40e1bd[_0x19df7a]][_0x799f('0x7e')](/"/g,'\x27'));switch(_0x19df7a){case _0x799f('0x45'):var _0x48a2b4=moment(_0x585996,_0x799f('0xd'),!![]);if(_0x48a2b4[_0x799f('0x7f')]()){_0x381113['push']('\x22'+_0x585996+'\x22');}else{_0xe8036b[_0x799f('0x19')](_0x799f('0x80'));}break;case _0x799f('0x30'):var _0x242137=parseInt(_0x585996);_0x585996=_['isNaN'](_0x242137)||_0x242137<0x0||_0x242137>0x4?_0x21f8ce?0x3:0x2:_0x242137;_0x381113[_0x799f('0x19')]('\x22'+_0x585996+'\x22');break;case _0x799f('0x31'):var _0x45c994=parseInt(_0x585996);if(_[_0x799f('0x81')](_0x45c994)&&_[_0x799f('0x82')](_0x465057,_0x45c994)){_0x381113['push']('\x22'+_0x45c994+'\x22');}else{_0xe8036b[_0x799f('0x19')](_0x799f('0x83'));}break;case _0x799f('0x84'):if(isEmail(_0x585996)){_0x381113[_0x799f('0x19')]('\x22'+_0x585996+'\x22');}else{_0xe8036b[_0x799f('0x19')](_0x799f('0x85'));}break;case'dateOfBirth':var _0x25b42d=moment(_0x585996,_0x799f('0x86'),!![]);if(_0x25b42d[_0x799f('0x7f')]()){_0x381113['push']('\x22'+_0x585996+'\x22');}else{_0xe8036b['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case'dialTimezone':var _0x4bd71c=shared['timezones'];var _0x5dafbb=_0x4bd71c[_0x585996];if(!_[_0x799f('0x7b')](_0x5dafbb)){var _0x5b0545=_0x5dafbb[_0x799f('0x67')];_0x381113['push']('\x22'+_0x585996+'\x22');_0x381113['push']('\x22'+_0x5b0545+'\x22');}break;default:_0x381113[_0x799f('0x19')]('\x22'+_0x585996+'\x22');}}else{switch(_0x19df7a){case _0x799f('0x87'):case'phone':_0xe8036b['push'](_0x19df7a+'\x20not\x20specified');break;default:_0x381113[_0x799f('0x19')]('\x22\x22');}}}}else{var _0x51257e='';if(!_[_0x799f('0x7b')](_0x3cbca6)){if(!_0x8cc6cd['hasOwnProperty'](_0x3cbca6['id'])){if(!_[_0x799f('0x7b')](_0x160519[_0x799f('0x79')][_0x4688d3][_0x40e1bd[_0x19df7a]])){var _0x585996=_[_0x799f('0x7d')](_0x160519['data'][_0x4688d3][_0x40e1bd[_0x19df7a]][_0x799f('0x7e')](/"/g,'\x27'));var _0x4a5be1=phoneDescriptions['find'](_0x275da4=>_0x275da4[_0x799f('0x88')]===_0x3cbca6['id']);if(!_[_0x799f('0x7b')](_0x4a5be1)){var _0x116889=_[_0x799f('0x7d')](_0x160519[_0x799f('0x79')][_0x4688d3][_0x40e1bd[_0x4a5be1[_0x799f('0x89')]]][_0x799f('0x7e')](/"/g,'\x27'));if(!_['isNil'](_0x116889))_0x585996=_0x585996+'§'+_0x116889;}if(_0x51257e=='')_0x51257e=_0x585996;else _0x51257e+='|'+_0x585996;}_0x85f3e8[_0x799f('0x19')](_0x3cbca6['id']+':'+_0x51257e);_0x8cc6cd[_0x3cbca6['id']]=0x1;}}}}if(hasAdditionalPhones){_0x381113[_0x799f('0x19')]('\x22'+_0x85f3e8[_0x799f('0x35')](';')+'\x22');}if(_0xe8036b[_0x799f('0x18')]){handleError(_0x160519[_0x799f('0x79')][_0x4688d3],{'code':_0x799f('0x8a'),'message':_0xe8036b['join']()});}else{fs[_0x799f('0x8b')](_0x540a49,_0x381113[_0x799f('0x35')]()+'\x0a');}_0x381113=[];}if(!(stats['rows']%0xc8)){socket['emit']('contact:import:'+_0x1ff895,stats);stats[_0x799f('0x57')]=[];}}if(stopped){logger[_0x799f('0x54')](_0x799f('0x8c'));_0x3f121a['abort']();}}catch(_0x407ff9){handleError(_0x160519[_0x799f('0x79')][_0x4688d3],{'code':_0x799f('0x8d'),'message':_0x407ff9[_0x799f('0x5b')]});logger['error'](_0x799f('0x8e'),_0x407ff9[_0x799f('0x5b')]);}},'complete':function(){try{var _0x487367=[];var _0x4290c7=[];var _0x5e889d=_0x799f('0x33');if(_0x1505dc[_0x799f('0x8f')]&&_0x1505dc[_0x799f('0x8f')][_0x799f('0x18')]){_0x5e889d=_0x799f('0x90')+_0x1ff895;_0x487367[_0x799f('0x19')](_0x799f('0x91')+_0x5e889d+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x799f('0x92')+_0x1ff895;tmp_voice_queues=_0x799f('0x93')+_0x1ff895;_0x4290c7['push']('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x4290c7['push'](_0x799f('0x91')+tmp_voice_queues+_0x799f('0x94'));BPromise[_0x799f('0x95')](_0x4290c7,handleTZQuery)['then'](function(_0x4355c4){updateTzCampaigns(_0x1505dc[_0x799f('0x2d')])[_0x799f('0x17')](function(_0x426f0d){updateTzVoiceQueues(_0x1505dc[_0x799f('0x2d')])[_0x799f('0x17')](function(_0x3cbd90){if(hasTZ)_0x37ffd3=_0x37ffd3[_0x799f('0x7e')](_0x799f('0x66'),_0x799f('0x96'));var _0x5f0d4e=util[_0x799f('0xc')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x540a49,_0x5e889d,_0x37ffd3,_0x1505dc[_0x799f('0x2d')],_0x1505dc[_0x799f('0x97')]||null,NOW,NOW);if(_[_0x799f('0x7b')](_0x40e1bd['scheduledat'])){_0x5f0d4e+=_0x799f('0x98');}_0x487367['push'](_0x5f0d4e);if(_0x1505dc[_0x799f('0x8f')]&&_0x1505dc['duplicates'][_0x799f('0x18')]){_0x487367[_0x799f('0x19')](insertCmContact(_0x1505dc['ListId'],_0x5e889d,_0x1505dc['duplicates'],_0x40e1bd));_0x487367[_0x799f('0x19')]('DROP\x20TABLE\x20'+_0x5e889d+';');}BPromise['each'](_0x487367,handleQuery)[_0x799f('0x17')](function(_0x120ccf){BPromise[_0x799f('0x1a')]([handleAdditionalPhones()])[_0x799f('0x17')](function(){_0x487367=[];for(var _0x437b17=0x0;_0x437b17<promisesAdditionalPhones[_0x799f('0x18')];_0x437b17++){if(promisesAdditionalPhones[_0x437b17][_0x799f('0x10')]!='§'){_0x487367['push'](createAdditionalPhone(promisesAdditionalPhones[_0x437b17]['contactId'],promisesAdditionalPhones[_0x437b17]['contactTypeId'],promisesAdditionalPhones[_0x437b17][_0x799f('0x10')],promisesAdditionalPhones[_0x437b17][_0x799f('0x99')]));}}BPromise[_0x799f('0x1a')](_0x487367)[_0x799f('0x17')](function(){_0x487367=[];if(hasTZ){_0x487367['push'](insertTzCmHopper(_0x1505dc[_0x799f('0x2d')],_0x799f('0x9a'),_0x799f('0x9b'),_0x799f('0x9c'),_0x21f8ce,tmp_voice_queues));_0x487367[_0x799f('0x19')](insertTzCmHopperBlack(_0x1505dc[_0x799f('0x2d')],_0x799f('0x9d'),'voice_queues',_0x799f('0x9c')));_0x487367[_0x799f('0x19')](insertTzCmHopper(_0x1505dc[_0x799f('0x2d')],_0x799f('0x5f'),_0x799f('0x5e'),_0x799f('0x9e'),_0x21f8ce,tmp_campaigns));_0x487367['push'](insertTzCmHopperBlack(_0x1505dc[_0x799f('0x2d')],_0x799f('0x9f'),_0x799f('0x5e'),'CampaignId'));_0x487367[_0x799f('0x19')](insertCmHopperAdditionalPhones(_0x1505dc[_0x799f('0x2d')]));}else{_0x487367[_0x799f('0x19')](insertCmHopper(_0x1505dc[_0x799f('0x2d')],_0x799f('0x9a'),_0x799f('0x9b'),_0x799f('0x9c'),_0x21f8ce));_0x487367[_0x799f('0x19')](insertCmHopperBlack(_0x1505dc[_0x799f('0x2d')],'voice_queues_has_cm_blacklists',_0x799f('0x9b'),'VoiceQueueId'));_0x487367[_0x799f('0x19')](insertCmHopper(_0x1505dc[_0x799f('0x2d')],_0x799f('0x5f'),_0x799f('0x5e'),'CampaignId',_0x21f8ce));_0x487367['push'](insertCmHopperBlack(_0x1505dc['ListId'],_0x799f('0x9f'),_0x799f('0x5e'),'CampaignId'));_0x487367[_0x799f('0x19')](insertCmHopperAdditionalPhones(_0x1505dc[_0x799f('0x2d')]));}_0x487367[_0x799f('0x19')](_0x799f('0xa0')+tmp_campaigns+';');_0x487367[_0x799f('0x19')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x799f('0x95')](_0x487367,handleQuery)[_0x799f('0x17')](function(_0x5bb18a){stats[_0x799f('0xa1')]=!![];stats['affectedRows']=_0x1505dc[_0x799f('0x8f')]&&_0x1505dc['duplicates'][_0x799f('0x18')]?results[0x2][_0x799f('0xa2')]:results[0x0][_0x799f('0xa2')];socket[_0x799f('0xa3')](_0x799f('0xa4')+_0x1ff895,stats);fs[_0x799f('0xa5')](_0x59d87c);fs[_0x799f('0xa5')](_0x540a49);process['exit'](0x0);})[_0x799f('0x5a')](function(_0xbd2b5){logger['error'](_0xbd2b5[_0x799f('0x5b')]);process[_0x799f('0x56')](0x1);});});});})['catch'](function(_0x498be6){logger[_0x799f('0x61')](_0x498be6['message']);process[_0x799f('0x56')](0x1);});});});});}catch(_0xc2145e){logger[_0x799f('0x61')](_0x799f('0xa6'),_0xc2145e[_0x799f('0x5b')]);process[_0x799f('0x56')](0x1);}},'error':function(_0x2e3695,_0x297f62,_0x391537,_0x54aee2){throw new Error(_0x54aee2);}});});}function validate(){if(process[_0x799f('0xa7')]&&process[_0x799f('0xa7')][_0x799f('0x18')]<0x4){throw new Error(_0x799f('0xa8'));}var _0x120c41=path[_0x799f('0x35')](config[_0x799f('0x70')],_0x799f('0xa9'),process[_0x799f('0xa7')][0x2]);if(!fs[_0x799f('0xaa')](_0x120c41)){throw new Error(_0x799f('0xab'));}var _0x1709f2={};try{_0x1709f2=JSON[_0x799f('0xac')](process[_0x799f('0xa7')][0x3]);if(!_0x1709f2[_0x799f('0x6d')]){throw new Error(_0x799f('0xad'));}if(!_0x1709f2[_0x799f('0x6d')][_0x799f('0x10')]){throw new Error(_0x799f('0xae'));}if(!_0x1709f2['binding'][_0x799f('0x87')]){throw new Error(_0x799f('0xaf'));}var _0x3f2b00=0x0;if(_0x1709f2[_0x799f('0x6d')]['UserId']){_0x3f2b00=0x1;}if(!_0x1709f2[_0x799f('0x2d')]){throw new Error(_0x799f('0xb0'));}}catch(_0x211b66){throw new Error('body\x20id\x20mandatory');}var _0x51e10a=[];try{_0x51e10a=_[_0x799f('0xb1')](JSON[_0x799f('0xac')](process['argv'][0x4]),'id');}catch(_0x259b9f){logger[_0x799f('0x54')](_0x799f('0xb2'));}main(_0x120c41,_0x1709f2,_0x51e10a,_0x3f2b00);}validate();process['on'](_0x799f('0xb3'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file