Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / whatsappInteraction / whatsappInteraction.controller.js
1 'use strict';const a955_0x4ecd=['@components/parsers/advancedSearch','Account','whatsapp_interactions','str','229847hdNiOk','CmContact','include','closedAt','isArray','find','a.key','agent','addTags','query','zip-dir','sequelize','i.WhatsappAccountId\x20IN\x20?','c.email','length','keys','toString','WhatsappInteraction','fullname','catch','c.lastName','groupBy','o.fullname','findAll','pick','users','pipe','moment','Contact.mobile','sort','i.id','whatsapp_accounts','forEach','where','clone','push','UserId','@config/logger','t.id\x20=\x20it.TagId','3Mbmvge','keyBy','field','out','conditions','Contact.lastName','resolve','end','isEmpty','error','478476JwddKc','createdAt','status','13049NNVBLJ','value','tag','sendStatus','u.id\x20=\x20ui.UserId','format','228027CmdbyF','mkdirSync','Account.mandatoryDisposition','i.*','WhatsappInteractionId','text','expr','type','lastName','isNumeric','secret','attachments','transcript-','omit','@components/export/lib/pdf','describe','a.mandatoryDisposition','direction','Contact.phone','unreadMessages','WhatsappAccountId','`unreadMessages`\x20>\x200','i.id\x20LIKE\x20?','params','offset','`unreadMessages`\x20=\x200','ui.WhatsappInteractionId\x20IN\x20?','filter','join','color','root','undefined','stack','@components/parsers/qs','disposition','c.fax','compact','fields','err','2468hgnXpQ','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','body','unlinkSync','o.id\x20=\x20i.UserId','WhatsappMessage','lodash','Owner','unix','Messages','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','order','left_join','map','addMessage','send','ContactId','u.id','68ikqevv','\x20=\x20?','getFullTextValue','Contact.email','Tags','operator','.pdf','options','@rediscache','YYYY-MM-DD\x20HH:mm:ss','get','register','@utils/filter-attributes','json','destroy','replace','i.WhatsappAccountId\x20IS\x20NULL','merge','role','createWriteStream','`\x20>\x200','show','$lte','download','filters','111227NSyNGg','user_has_whatsapp_interactions','\x20IS\x20NULL','getMessages','a.id\x20=\x20i.WhatsappAccountId','@mysqldb','set','rows','Contact','86idaaNQ','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','start','some','split','removeTags','concat','GROUP_CONCAT(DISTINCT\x20t.id)','User','findOne','create','attributes','parse','search','from','group','TagIds','8069bMCrUi','files','path','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','it.WhatsappInteractionId\x20=\x20i.id','includeAll','closed','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','u.fullname','2ttdCJP','update','count','intersection','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','renderFile','cm_contacts','Owner.internal','75tkwdHR','tools_tags','select','null','N.A.','parseSearch','having','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','Content-Range','basename','ids','contactName','pathExists','whatsapp_messages','firstName','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','$gte','read','fieldName','rawAttributes','Tag','@utils/console-logger','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','whatsappInteractionTags:save','ui.WhatsappInteractionId','Attachment','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','model','`\x20=\x200','then','whatsapp_interaction_has_tags','buildExpression','me.WhatsappInteractionId\x20=\x20i.id','ejs','limit','user','name'];const a955_0xc330=function(_0x35dd2b,_0x500cd5){_0x35dd2b=_0x35dd2b-0xc2;let _0x4ecdbd=a955_0x4ecd[_0x35dd2b];return _0x4ecdbd;};const a955_0x4ac46c=a955_0xc330;(function(_0x59f643,_0x4a485f){const _0x2ead1b=a955_0xc330;while(!![]){try{const _0x43d643=-parseInt(_0x2ead1b(0xfa))+parseInt(_0x2ead1b(0x155))*parseInt(_0x2ead1b(0xf0))+parseInt(_0x2ead1b(0xc9))+parseInt(_0x2ead1b(0x15e))*-parseInt(_0x2ead1b(0x12a))+parseInt(_0x2ead1b(0x180))*-parseInt(_0x2ead1b(0x16f))+parseInt(_0x2ead1b(0x178))*parseInt(_0x2ead1b(0x103))+parseInt(_0x2ead1b(0xfd))*parseInt(_0x2ead1b(0x13c));if(_0x43d643===_0x4a485f)break;else _0x59f643['push'](_0x59f643['shift']());}catch(_0x339c06){_0x59f643['push'](_0x59f643['shift']());}}}(a955_0x4ecd,0x952c7));const {createPdfFromHTML}=require(a955_0x4ac46c(0x111)),rimraf=require('rimraf'),zipdir=require(a955_0x4ac46c(0xd3)),moment=require(a955_0x4ac46c(0xe4)),util=require('util'),path=require(a955_0x4ac46c(0x171)),ejs=require(a955_0x4ac46c(0x1a1)),fs=require('fs-extra'),_=require(a955_0x4ac46c(0x130)),squel=require('squel'),{getSocket}=require(a955_0x4ac46c(0x144)),socket=getSocket(),qs=require(a955_0x4ac46c(0x124)),as=require(a955_0x4ac46c(0xc5)),logger=require(a955_0x4ac46c(0xee))('api'),{getConfig}=require('@config/get-config'),config=getConfig(),{db}=require(a955_0x4ac46c(0x15a)),{Op,QueryTypes}=require('sequelize'),{consoleLogger}=require(a955_0x4ac46c(0x195)),{filterAttributes}=require(a955_0x4ac46c(0x148));require('./whatsappInteraction.socket')[a955_0x4ac46c(0x147)](socket);function respondWithStatusCode(_0x554b22,_0xed0848){return _0xed0848=_0xed0848||0xcc,function(_0x19dd23){const _0x23d262=a955_0xc330;if(_0x19dd23)return _0x554b22['sendStatus'](_0xed0848);return _0x554b22['status'](_0xed0848)[_0x23d262(0xf7)]();};}function respondWithResult(_0xaaa82e,_0x1eb81f){return _0x1eb81f=_0x1eb81f||0xc8,function(_0x5636cd){const _0x2efc8a=a955_0xc330;if(_0x5636cd)return _0xaaa82e[_0x2efc8a(0xfc)](_0x1eb81f)[_0x2efc8a(0x149)](_0x5636cd);};}function respondWithFilteredResult(_0x8a3c3a,_0x4f2bc1){return function(_0x302988){const _0x896096=a955_0xc330;if(_0x302988){const _0xe29272=_0x302988[_0x896096(0x17a)],_0xafe899=_0x4f2bc1[_0x896096(0x11b)];let _0x18287e=_0x4f2bc1[_0x896096(0x11b)]+_0x4f2bc1[_0x896096(0xc2)],_0x3270b6;return _0x18287e>=_0xe29272?(_0x18287e=_0xe29272,_0x3270b6=0xc8):_0x3270b6=0xce,_0x8a3c3a[_0x896096(0xfc)](_0x3270b6),_0x8a3c3a[_0x896096(0x15b)](_0x896096(0x188),_0xafe899+'-'+_0x18287e+'/'+_0xe29272)['json'](_0x302988);}return null;};}function saveUpdates(_0x34a972){return function(_0x44aa80){const _0x1e95f5=a955_0xc330;if(_0x44aa80)return _0x44aa80[_0x1e95f5(0x179)](_0x34a972)[_0x1e95f5(0x19d)](function(_0x448ec6){return _0x448ec6;});return null;};}function removeEntity(_0x2ec63b){return function(_0x2c36c1){const _0x2462ca=a955_0xc330;if(_0x2c36c1)return _0x2c36c1[_0x2462ca(0x14a)]()[_0x2462ca(0x19d)](function(){_0x2ec63b['status'](0xcc)['end']();});};}function handleEntityNotFound(_0x174fc1){return function(_0x17ae16){const _0xb5f356=a955_0xc330;return!_0x17ae16&&_0x174fc1[_0xb5f356(0x100)](0x194),_0x17ae16;};}function handleError(_0x350bb0,_0x3f3623){return _0x3f3623=_0x3f3623||0x1f4,function(_0x4115c0){const _0x39fb8d=a955_0xc330;logger[_0x39fb8d(0xf9)](_0x4115c0[_0x39fb8d(0x123)]),_0x4115c0['name']&&delete _0x4115c0['name'],_0x350bb0[_0x39fb8d(0xfc)](_0x3f3623)[_0x39fb8d(0x139)](_0x4115c0);};}function getInteractionUsers(_0x2f177a,_0x421b15){return new Promise(function(_0x4be01e,_0x290342){const _0x5744f6=a955_0xc330;try{_0x421b15[_0x2f177a['id']]&&(_0x2f177a['Users']=_[_0x5744f6(0x137)](_0x421b15[_0x2f177a['id']],function(_0x4a771d){const _0x4df440=_0x5744f6;return{'id':_0x4a771d['id'],'fullname':_0x4a771d[_0x4df440(0xdb)]};}));}catch(_0x326041){_0x290342(_0x326041);}_0x4be01e(_0x2f177a);});}function getInteractionTags(_0x40c9b0,_0x3659d2){return new Promise(function(_0x3cd428,_0x51dff7){const _0x544450=a955_0xc330;try{_0x40c9b0[_0x544450(0x16e)]&&(_0x40c9b0[_0x544450(0x140)]=[],_0x40c9b0['TagIds'][_0x544450(0x162)](',')['forEach'](function(_0x48afe6){const _0x1cf6be=_0x544450;_0x40c9b0[_0x1cf6be(0x140)]['push'](_0x3659d2[_0x48afe6]);})),delete _0x40c9b0['TagIds'];}catch(_0x401b32){_0x51dff7(_0x401b32);}_0x3cd428(_0x40c9b0);});}function updateWhatsappInteraction(_0x5a0be6,_0x292a5c,_0x1f36b6){return new Promise(function(_0x4511b2,_0x537c4c){const _0x4e9c38=a955_0xc330;return getInteractionUsers(_0x5a0be6,_0x1f36b6)['then'](function(_0x48637c){return getInteractionTags(_0x48637c,_0x292a5c);})[_0x4e9c38(0x19d)](function(_0x43b3c7){_0x4511b2(_0x43b3c7);})[_0x4e9c38(0xdc)](function(_0xc49c64){_0x537c4c(_0xc49c64);});});}exports['index']=function(_0x4c169e,_0x3b89cd){const _0xfd8b39=a955_0x4ac46c,_0x44ca7b={},_0x45a69e={},_0x54cae5={'count':0x0,'rows':[]},_0x9353c=_[_0xfd8b39(0x137)](db['WhatsappInteraction'][_0xfd8b39(0x193)],function(_0x245bd8){const _0x4e16f6=_0xfd8b39;return{'name':_0x245bd8[_0x4e16f6(0x192)],'type':_0x245bd8['type']['key']};});_0x45a69e[_0xfd8b39(0x19b)]=_[_0xfd8b39(0x137)](_0x9353c,'name'),_0x45a69e[_0xfd8b39(0xd2)]=_[_0xfd8b39(0xd8)](_0x4c169e[_0xfd8b39(0xd2)]),_0x45a69e['filters']=_[_0xfd8b39(0x17b)](_0x45a69e['model'],_0x45a69e[_0xfd8b39(0xd2)]),_0x44ca7b[_0xfd8b39(0x169)]=_[_0xfd8b39(0x17b)](_0x45a69e['model'],qs[_0xfd8b39(0x128)](_0x4c169e['query'][_0xfd8b39(0x128)])),_0x44ca7b[_0xfd8b39(0x169)]=_0x44ca7b[_0xfd8b39(0x169)][_0xfd8b39(0xd7)]?_0x44ca7b[_0xfd8b39(0x169)]:_0x45a69e[_0xfd8b39(0x19b)];typeof _0x4c169e['query']['nolimit']===_0xfd8b39(0x122)&&(_0x44ca7b[_0xfd8b39(0xc2)]=qs[_0xfd8b39(0xc2)](_0x4c169e[_0xfd8b39(0xd2)]['limit']),_0x44ca7b['offset']=qs[_0xfd8b39(0x11b)](_0x4c169e[_0xfd8b39(0xd2)][_0xfd8b39(0x11b)]));_0x44ca7b[_0xfd8b39(0x135)]=qs[_0xfd8b39(0xe6)](_0x4c169e[_0xfd8b39(0xd2)][_0xfd8b39(0xe6)]),_0x44ca7b[_0xfd8b39(0xea)]=qs[_0xfd8b39(0x154)](_[_0xfd8b39(0xe1)](_0x4c169e[_0xfd8b39(0xd2)],_0x45a69e[_0xfd8b39(0x154)]),_0x9353c);let _0x2b1c76=[];const _0x1b94c3=squel[_0xfd8b39(0x182)]()[_0xfd8b39(0xf2)]('id')[_0xfd8b39(0xf2)](_0xfd8b39(0xc4))[_0xfd8b39(0xf2)](_0xfd8b39(0x120))[_0xfd8b39(0x16c)](_0xfd8b39(0x181)),_0x1048e2=squel[_0xfd8b39(0x182)]()[_0xfd8b39(0xf2)](_0xfd8b39(0x13b))[_0xfd8b39(0xf2)](_0xfd8b39(0x177))['field'](_0xfd8b39(0x198))[_0xfd8b39(0x16c)](_0xfd8b39(0x156),'ui')[_0xfd8b39(0x136)](_0xfd8b39(0xe2),'u',_0xfd8b39(0x101)),_0x4c1e97=squel[_0xfd8b39(0x182)]()['from'](_0xfd8b39(0xc7),'i')[_0xfd8b39(0x136)](_0xfd8b39(0x17e),'c',_0xfd8b39(0x176))[_0xfd8b39(0x136)](_0xfd8b39(0xe2),'o',_0xfd8b39(0x12e))['left_join'](_0xfd8b39(0xe8),'a',_0xfd8b39(0x159))[_0xfd8b39(0x136)](_0xfd8b39(0x18d),'me',_0xfd8b39(0x1a0))[_0xfd8b39(0x136)](_0xfd8b39(0x19e),'it',_0xfd8b39(0x173))[_0xfd8b39(0x136)](_0xfd8b39(0x181),'t',_0xfd8b39(0xef)),_0x5a6c2f=squel['expr']();let _0x1e83fe=[];const _0x522b83=squel[_0xfd8b39(0x109)]();let _0x4ae2c5;if(_0x4c169e[_0xfd8b39(0xd2)][_0xfd8b39(0x16b)]){_0x4ae2c5=as[_0xfd8b39(0x185)](_0x4c169e[_0xfd8b39(0xd2)]['search']);const _0x2f6aae=_0x4ae2c5['sqlOperator'];for(let _0x39a098=0x0;_0x39a098<_0x4ae2c5[_0xfd8b39(0xf4)]['length'];_0x39a098++){const _0x5eff61=_0x4ae2c5[_0xfd8b39(0xf4)][_0x39a098],_0x3965b0='i';let _0x57cafd,_0x1c881a=null,_0x12ca00=_[_0xfd8b39(0xce)](_0x9353c,['name',_0x5eff61['field']]);if(!_0x12ca00)switch(_0x5eff61[_0xfd8b39(0xf2)]){case _0xfd8b39(0x116):Number(_0x5eff61[_0xfd8b39(0xfe)])===0x1?_0x4c1e97[_0xfd8b39(0x186)]('`'+_0x5eff61[_0xfd8b39(0xf2)]+_0xfd8b39(0x19c)):_0x4c1e97[_0xfd8b39(0x186)]('`'+_0x5eff61[_0xfd8b39(0xf2)]+_0xfd8b39(0x150));break;case _0xfd8b39(0x15d):if(_0x5eff61['operator']==='$substring'){if(_0x5eff61[_0xfd8b39(0xfe)][_0xfd8b39(0x162)]('\x20')[_0xfd8b39(0xd7)]>0x1)_0x1c881a=squel['str'](_0xfd8b39(0x134),qs[_0xfd8b39(0x13e)](_0x5eff61[_0xfd8b39(0xfe)]),null);else{const _0x14ad2f='%'+_0x5eff61[_0xfd8b39(0xfe)]+'%';_0x1c881a=squel[_0xfd8b39(0xc8)](_0xfd8b39(0x17c),_0x14ad2f,_0x14ad2f,_0x14ad2f);}}else _0x12ca00=_[_0xfd8b39(0xce)](_0x9353c,[_0xfd8b39(0xc4),_0xfd8b39(0x13a)]),_0x5eff61[_0xfd8b39(0xf2)]=_0xfd8b39(0x13a),_0x57cafd=as['buildExpression'](_0x3965b0,_0x12ca00[_0xfd8b39(0x10a)],_0x5eff61),_0x1c881a=squel['str'](_0x57cafd['text'],_0x57cafd[_0xfd8b39(0xfe)][_0xfd8b39(0x160)],_0x57cafd['value']['end']);break;case _0xfd8b39(0x194):{const _0xe19639=_0x5eff61['value'][_0xfd8b39(0x162)](',')[_0xfd8b39(0x137)](function(_0x5cd91f){return Number(_0x5cd91f);});_0xe19639[_0xfd8b39(0xe9)](function(_0x348d87){const _0x5d0787=_0xfd8b39;_0x522b83['or'](squel[_0x5d0787(0xc8)]('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x348d87+',%'));}),_0x1e83fe=_['union'](_0x1e83fe,_0xe19639);}break;case _0xfd8b39(0x166):_0x5eff61[_0xfd8b39(0x141)]==='$substring'?_0x1c881a=squel[_0xfd8b39(0xc8)](_0xfd8b39(0x172),'%'+_0x5eff61['value']+'%',null):(_0x12ca00=_[_0xfd8b39(0xce)](_0x9353c,['name','UserId']),_0x5eff61[_0xfd8b39(0xf2)]=_0xfd8b39(0xed),_0x57cafd=as[_0xfd8b39(0x19f)](_0x3965b0,_0x12ca00[_0xfd8b39(0x10a)],_0x5eff61),_0x1c881a=squel[_0xfd8b39(0xc8)](_0x57cafd[_0xfd8b39(0x108)],_0x57cafd[_0xfd8b39(0xfe)][_0xfd8b39(0x160)],_0x57cafd[_0xfd8b39(0xfe)][_0xfd8b39(0xf7)]));break;case _0xfd8b39(0x12c):_0x57cafd=as[_0xfd8b39(0x19f)]('me',null,_0x5eff61),_0x1c881a=squel['str'](_0x57cafd[_0xfd8b39(0x108)],_0x57cafd[_0xfd8b39(0xfe)]['start'],_0x57cafd[_0xfd8b39(0xfe)][_0xfd8b39(0xf7)]);break;}else _0x57cafd=as[_0xfd8b39(0x19f)](_0x3965b0,_0x12ca00[_0xfd8b39(0x10a)],_0x5eff61),_0x1c881a=squel['str'](_0x57cafd[_0xfd8b39(0x108)],_0x57cafd[_0xfd8b39(0xfe)]['start'],_0x57cafd['value'][_0xfd8b39(0xf7)]);_0x1c881a&&_0x5a6c2f[_0x2f6aae](_0x1c881a);}}else{const _0x2f80ab=_(_0x4c169e[_0xfd8b39(0xd2)])['keys']()[_0xfd8b39(0x137)](function(_0x3eaedf){const _0x1e414d=_0xfd8b39;return _[_0x1e414d(0x161)](_0x9353c,[_0x1e414d(0xc4),_0x3eaedf])?_0x3eaedf:undefined;})[_0xfd8b39(0x127)]()[_0xfd8b39(0xfe)]();!_['isEmpty'](_0x2f80ab)&&_0x2f80ab['forEach'](function(_0x131186){const _0x24267b=_0xfd8b39;if(_0x131186==='WhatsappAccountId')_0x4c1e97[_0x24267b(0xea)](_0x24267b(0xd5),[][_0x24267b(0x164)](_0x4c169e['query'][_0x131186]));else{if(_0x131186==='createdAt'){const _0x353df2=JSON['parse'](_0x4c169e[_0x24267b(0xd2)][_0x131186])[_0x24267b(0x190)],_0x2acd24=JSON[_0x24267b(0x16a)](_0x4c169e[_0x24267b(0xd2)][_0x131186])[_0x24267b(0x152)];_0x4c1e97[_0x24267b(0xea)](_0x24267b(0x12b),_0x353df2,_0x2acd24);}else _0x4c169e[_0x24267b(0xd2)][_0x131186]===_0x24267b(0x183)?_0x4c1e97[_0x24267b(0xea)]('i.'+_0x131186+_0x24267b(0x157)):_0x4c1e97[_0x24267b(0xea)]('i.'+_0x131186+_0x24267b(0x13d),_0x4c169e[_0x24267b(0xd2)][_0x131186]);}});_0x4c169e['query'][_0xfd8b39(0x191)]&&(Number(_0x4c169e['query']['read'])===0x1?_0x4c1e97['having'](_0xfd8b39(0x11c)):_0x4c1e97[_0xfd8b39(0x186)](_0xfd8b39(0x118)));_0x4c169e[_0xfd8b39(0xd2)][_0xfd8b39(0xff)]&&(_0x1e83fe=_[_0xfd8b39(0xcd)](_0x4c169e[_0xfd8b39(0xd2)][_0xfd8b39(0xff)])?_0x4c169e[_0xfd8b39(0xd2)]['tag']:new Array(_0x4c169e['query'][_0xfd8b39(0xff)]),_0x1e83fe[_0xfd8b39(0xe9)](function(_0x320f05){const _0x2d2a3b=_0xfd8b39;_0x522b83['or'](squel[_0x2d2a3b(0xc8)]('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x320f05+',%'));}));if(_0x4c169e['query'][_0xfd8b39(0x11e)]){const _0x5e5828=_0x4c169e['query'][_0xfd8b39(0x11e)][_0xfd8b39(0x14b)]('\x5c','\x5c\x5c')[_0xfd8b39(0x14b)](/'/g,'\x27\x27');qs[_0xfd8b39(0x10c)](_0x5e5828)?_0x5a6c2f['or'](squel['str'](_0xfd8b39(0x119),_0x5e5828+'%'))['or'](squel[_0xfd8b39(0xc8)]('i.phone\x20LIKE\x20?',_0x5e5828+'%')):_0x5a6c2f['or'](squel['str'](_0xfd8b39(0x196),qs[_0xfd8b39(0x13e)](_0x5e5828)))['or'](squel[_0xfd8b39(0xc8)](_0xfd8b39(0x15f),_0x5e5828+'%'));}}_0x4c1e97['where'](_0x5a6c2f),_0x4c1e97[_0xfd8b39(0x16d)](_0xfd8b39(0xe7));let _0x3d46b8={'type':QueryTypes['SELECT'],'raw':!![]};const _0xfdd56c=_0x4c1e97[_0xfd8b39(0xeb)]();_0xfdd56c[_0xfd8b39(0xf2)](_0xfd8b39(0xe7)),_0xfdd56c['field'](_0xfd8b39(0x18f),_0xfd8b39(0x116)),_0x44ca7b[_0xfd8b39(0x135)]&&_0x44ca7b[_0xfd8b39(0x135)][_0xfd8b39(0xe9)](function(_0x280883){const _0x49414b=_0xfd8b39,_0x526ff8=_0x280883[0x0]===_0x49414b(0x18b)?_0x280883[0x0]:'i.'+_0x280883[0x0];_0x4c1e97[_0x49414b(0x135)](_0x526ff8,_0x280883[0x1]==='DESC'?![]:!![]);}),!_[_0xfd8b39(0xf8)](_0x1e83fe)&&(_0x4c1e97[_0xfd8b39(0x186)](_0x522b83),_0xfdd56c['where']('t.id\x20IN\x20?',_0x1e83fe)),Promise[_0xfd8b39(0xf6)]()['then'](function(){const _0x328d11=_0xfd8b39;if(!_0x4ae2c5){if(_0x4c169e[_0x328d11(0xd2)][_0x328d11(0x117)])return;_0xfdd56c[_0x328d11(0xea)](_0x328d11(0x19a)),_0x4c1e97[_0x328d11(0xea)]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4c169e[_0x328d11(0xc3)][_0x328d11(0x14e)]!==_0x328d11(0xd0))return;return _0x4c169e[_0x328d11(0xc3)]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x328d11(0x19d)](function(_0x215515){const _0x1eb72b=_0x328d11;_[_0x1eb72b(0xf8)](_0x215515)?(_0xfdd56c['where'](_0x1eb72b(0x14c)),_0x4c1e97[_0x1eb72b(0xea)](_0x1eb72b(0x14c))):(_0xfdd56c[_0x1eb72b(0xea)]('i.WhatsappAccountId\x20IN\x20?',_[_0x1eb72b(0x137)](_0x215515,'id')),_0x4c1e97[_0x1eb72b(0xea)](_0x1eb72b(0xd5),_['map'](_0x215515,'id')));});})[_0xfd8b39(0x19d)](function(){const _0x269b2f=_0xfd8b39;if(_0x4c169e[_0x269b2f(0xc3)][_0x269b2f(0x14e)]==='agent'&&!_0x4ae2c5&&!_0x4c169e['query']['WhatsappAccountId'])return[];return db[_0x269b2f(0xd4)]['query'](_0xfdd56c[_0x269b2f(0xd9)](),_0x3d46b8);})[_0xfd8b39(0x19d)](function(_0x2f22b9){const _0x57070d=_0xfd8b39;_0x54cae5[_0x57070d(0x17a)]=_0x2f22b9['length'];if(_0x54cae5[_0x57070d(0x17a)]===0x0)return[];return db[_0x57070d(0xd4)][_0x57070d(0xd2)](_0x1b94c3[_0x57070d(0xd9)](),_0x3d46b8)[_0x57070d(0x19d)](function(_0x55c73d){const _0x36fc2c=_0x57070d;_0x2b1c76=_[_0x36fc2c(0xf1)](_0x55c73d,'id'),_0x3d46b8=_[_0x36fc2c(0x14d)](_0x3d46b8,{'model':db[_0x36fc2c(0xda)],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4c169e[_0x36fc2c(0xd2)][_0x36fc2c(0x128)]?_0x44ca7b['attributes']['forEach'](function(_0x33ce99){const _0x508eb5=_0x36fc2c;_0x4c1e97[_0x508eb5(0xf2)]('i.'+_0x33ce99);}):(_0x4c1e97[_0x36fc2c(0xf2)]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x36fc2c(0x116)),_0x4c1e97[_0x36fc2c(0xf2)](_0x36fc2c(0xcf),'Account.key'),_0x4c1e97[_0x36fc2c(0xf2)](_0x36fc2c(0x113),_0x36fc2c(0x105)),_0x4c1e97['field'](_0x36fc2c(0x187),_0x36fc2c(0x18b)),_0x4c1e97['field'](_0x36fc2c(0x106)),_0x4c1e97[_0x36fc2c(0xf2)]('c.firstName','Contact.firstName'),_0x4c1e97[_0x36fc2c(0xf2)](_0x36fc2c(0xdd),_0x36fc2c(0xf5)),_0x4c1e97['field'](_0x36fc2c(0xd6),_0x36fc2c(0x13f)),_0x4c1e97[_0x36fc2c(0xf2)]('c.phone',_0x36fc2c(0x115)),_0x4c1e97[_0x36fc2c(0xf2)]('c.mobile',_0x36fc2c(0xe5)),_0x4c1e97[_0x36fc2c(0xf2)](_0x36fc2c(0x126),'Contact.fax'),_0x4c1e97['field'](_0x36fc2c(0xdf),'Owner.fullname'),_0x4c1e97[_0x36fc2c(0xf2)]('o.internal',_0x36fc2c(0x17f)),_0x4c1e97[_0x36fc2c(0xf2)](_0x36fc2c(0x165),'TagIds'));if(_0x44ca7b[_0x36fc2c(0xc2)])_0x4c1e97[_0x36fc2c(0xc2)](_0x44ca7b[_0x36fc2c(0xc2)]);if(_0x44ca7b[_0x36fc2c(0x11b)])_0x4c1e97['offset'](_0x44ca7b[_0x36fc2c(0x11b)]);return db[_0x36fc2c(0xd4)][_0x36fc2c(0xd2)](_0x4c1e97[_0x36fc2c(0xd9)](),_0x3d46b8);})[_0x57070d(0x19d)](function(_0xff9462){const _0x2943a1=_0x57070d;return _0x1048e2[_0x2943a1(0xea)](_0x2943a1(0x11d),_[_0x2943a1(0x137)](_0xff9462,'id')),db['sequelize'][_0x2943a1(0xd2)](_0x1048e2[_0x2943a1(0xd9)](),_0x3d46b8)[_0x2943a1(0x19d)](function(_0x38afa7){const _0x180cd1=_0x2943a1,_0x4c88a6=_[_0x180cd1(0xde)](_0x38afa7,'WhatsappInteractionId'),_0x3001b2=[];return _0xff9462[_0x180cd1(0xe9)](function(_0x5311c1){const _0x4f86fa=_0x180cd1;_0x3001b2[_0x4f86fa(0xec)](updateWhatsappInteraction(_0x5311c1,_0x2b1c76,_0x4c88a6));}),Promise['all'](_0x3001b2);});});})[_0xfd8b39(0x19d)](function(_0x30887c){const _0x43984a=_0xfd8b39;return _0x54cae5[_0x43984a(0x15c)]=_0x30887c,_0x54cae5;})[_0xfd8b39(0x19d)](respondWithFilteredResult(_0x3b89cd,_0x44ca7b))[_0xfd8b39(0xdc)](handleError(_0x3b89cd,null));},exports[a955_0x4ac46c(0x151)]=function(_0x365337,_0x538654){const _0x388c52=a955_0x4ac46c;let _0x437b87={'raw':![],'where':{'id':_0x365337[_0x388c52(0x11a)]['id']}};const _0x140904={};return _0x140904['model']=_[_0x388c52(0xd8)](db[_0x388c52(0xda)]['rawAttributes']),_0x140904[_0x388c52(0xd2)]=_[_0x388c52(0xd8)](_0x365337[_0x388c52(0xd2)]),_0x140904[_0x388c52(0x154)]=_[_0x388c52(0x17b)](_0x140904[_0x388c52(0x19b)],_0x140904[_0x388c52(0xd2)]),_0x437b87[_0x388c52(0x169)]=_['intersection'](_0x140904[_0x388c52(0x19b)],qs['fields'](_0x365337['query'][_0x388c52(0x128)])),_0x437b87[_0x388c52(0x169)]=_0x437b87[_0x388c52(0x169)][_0x388c52(0xd7)]?_0x437b87[_0x388c52(0x169)]:_0x140904[_0x388c52(0x19b)],_0x365337[_0x388c52(0xd2)][_0x388c52(0x174)]&&(_0x437b87['include']=[{'all':!![]}]),_0x437b87=_[_0x388c52(0x14d)]({},_0x437b87,_0x365337[_0x388c52(0x143)]),db[_0x388c52(0xda)][_0x388c52(0x167)](_0x437b87)[_0x388c52(0x19d)](handleEntityNotFound(_0x538654,null))[_0x388c52(0x19d)](respondWithResult(_0x538654,null))['catch'](handleError(_0x538654,null));},exports[a955_0x4ac46c(0x168)]=function(_0x4aca72,_0x5cdbe2){const _0x40fc02=a955_0x4ac46c;return db[_0x40fc02(0xda)]['create'](_0x4aca72[_0x40fc02(0x12c)],{})['then'](respondWithResult(_0x5cdbe2,0xc9))[_0x40fc02(0xdc)](handleError(_0x5cdbe2,null));},exports[a955_0x4ac46c(0x179)]=function(_0x48bc64,_0x2b83e5){const _0x2d9686=a955_0x4ac46c;return _0x48bc64['body']['id']&&delete _0x48bc64[_0x2d9686(0x12c)]['id'],db[_0x2d9686(0xda)][_0x2d9686(0x167)]({'where':{'id':_0x48bc64[_0x2d9686(0x11a)]['id']}})[_0x2d9686(0x19d)](handleEntityNotFound(_0x2b83e5,null))[_0x2d9686(0x19d)](saveUpdates(_0x48bc64['body'],null))['then'](respondWithResult(_0x2b83e5,null))[_0x2d9686(0xdc)](handleError(_0x2b83e5,null));},exports[a955_0x4ac46c(0x14a)]=function(_0x5960a4,_0x3cdf06){const _0x7eb965=a955_0x4ac46c;return db[_0x7eb965(0xda)]['findOne']({'where':{'id':_0x5960a4[_0x7eb965(0x11a)]['id']}})['then'](handleEntityNotFound(_0x3cdf06,null))[_0x7eb965(0x19d)](removeEntity(_0x3cdf06,null))[_0x7eb965(0xdc)](handleError(_0x3cdf06,null));},exports[a955_0x4ac46c(0x112)]=function(_0x25f403,_0x5674b9){const _0x32957e=a955_0x4ac46c;return db[_0x32957e(0xda)][_0x32957e(0x112)]()[_0x32957e(0x19d)](respondWithResult(_0x5674b9,null))[_0x32957e(0xdc)](handleError(_0x5674b9,null));},exports[a955_0x4ac46c(0x138)]=function(_0x448c7c,_0x1bd2f1){const _0x47a7de=a955_0x4ac46c;return db[_0x47a7de(0x12f)][_0x47a7de(0x167)]({'where':{'id':_0x448c7c[_0x47a7de(0x11a)]['id']}})[_0x47a7de(0x19d)](function(_0x28525d){const _0x511f92=_0x47a7de;if(_0x28525d)return _0x28525d['addMessage'](_0x448c7c[_0x511f92(0x12c)][_0x511f92(0x18a)],{'through':_[_0x511f92(0x110)](_0x448c7c[_0x511f92(0x12c)],[_0x511f92(0x18a),'id'])});})[_0x47a7de(0x19d)](respondWithResult(_0x1bd2f1,null))['catch'](handleError(_0x1bd2f1,null));},exports[a955_0x4ac46c(0x158)]=function(_0x434ef7,_0x25ed30){const _0x35ec73=a955_0x4ac46c;let _0x5e7f3d={'raw':![],'where':{}};const _0x34cd75={},_0x4e74b2={'count':0x0,'rows':[]};return db[_0x35ec73(0xda)][_0x35ec73(0x167)]({'where':{'id':_0x434ef7['params']['id']}})[_0x35ec73(0x19d)](handleEntityNotFound(_0x25ed30,null))[_0x35ec73(0x19d)](function(_0x22c095){const _0x40967c=_0x35ec73;if(_0x22c095){_0x34cd75[_0x40967c(0x19b)]=_[_0x40967c(0xd8)](db[_0x40967c(0x12f)][_0x40967c(0x193)]),_0x34cd75[_0x40967c(0xd2)]=_[_0x40967c(0xd8)](_0x434ef7[_0x40967c(0xd2)]),_0x34cd75[_0x40967c(0x154)]=_['intersection'](_0x34cd75[_0x40967c(0x19b)],_0x34cd75[_0x40967c(0xd2)]),_0x5e7f3d[_0x40967c(0x169)]=_[_0x40967c(0x17b)](_0x34cd75[_0x40967c(0x19b)],qs['fields'](_0x434ef7[_0x40967c(0xd2)]['fields'])),_0x5e7f3d['attributes']=_0x5e7f3d[_0x40967c(0x169)]['length']?_0x5e7f3d[_0x40967c(0x169)]:_0x34cd75['model'];typeof _0x434ef7['query']['nolimit']==='undefined'&&(_0x5e7f3d[_0x40967c(0xc2)]=qs[_0x40967c(0xc2)](_0x434ef7[_0x40967c(0xd2)][_0x40967c(0xc2)]),_0x5e7f3d[_0x40967c(0x11b)]=qs['offset'](_0x434ef7[_0x40967c(0xd2)][_0x40967c(0x11b)]));_0x5e7f3d[_0x40967c(0x135)]=qs['sort'](_0x434ef7[_0x40967c(0xd2)]['sort']),_0x5e7f3d[_0x40967c(0xea)]=qs[_0x40967c(0x154)](_['pick'](_0x434ef7[_0x40967c(0xd2)],_0x34cd75[_0x40967c(0x154)])),_0x5e7f3d[_0x40967c(0xea)][_0x40967c(0x107)]=_0x22c095['id'];_0x434ef7['query'][_0x40967c(0x11e)]&&(_0x5e7f3d=filterAttributes(_0x5e7f3d,_0x434ef7[_0x40967c(0xd2)][_0x40967c(0x11e)],_0x5e7f3d[_0x40967c(0x169)],_0x434ef7[_0x40967c(0x143)],![]));if(_0x434ef7['query']['$gte']){const _0x4f5eeb=_0x434ef7[_0x40967c(0xd2)][_0x40967c(0x190)][_0x40967c(0x162)](','),_0xb7d32a={};_0xb7d32a[_0x4f5eeb[0x0]]={[Op['gte']]:moment(_0x4f5eeb[0x1])[_0x40967c(0x102)]('YYYY-MM-DD\x20HH:mm:ss')},_0x5e7f3d[_0x40967c(0xea)]={..._0x5e7f3d[_0x40967c(0xea)],..._0xb7d32a};}return _0x5e7f3d={..._0x5e7f3d,..._0x434ef7[_0x40967c(0x143)]},db[_0x40967c(0x12f)]['count']({'where':_0x5e7f3d[_0x40967c(0xea)]})[_0x40967c(0x19d)](function(_0x557174){const _0x3c4def=_0x40967c;return _0x4e74b2[_0x3c4def(0x17a)]=_0x557174,_0x434ef7[_0x3c4def(0xd2)][_0x3c4def(0x174)]&&(_0x5e7f3d[_0x3c4def(0xcb)]=[{'all':!![]}]),db[_0x3c4def(0x12f)]['findAll'](_0x5e7f3d);})['then'](function(_0x129b09){const _0x1c6aad=_0x40967c;return _0x4e74b2[_0x1c6aad(0x15c)]=_0x129b09,_0x4e74b2;});}})[_0x35ec73(0x19d)](respondWithFilteredResult(_0x25ed30,_0x5e7f3d))['catch'](handleError(_0x25ed30,null));},exports[a955_0x4ac46c(0xd1)]=function(_0x1077aa,_0xaa0788){const _0x425d42=a955_0x4ac46c;return db[_0x425d42(0xda)][_0x425d42(0x167)]({'where':{'id':_0x1077aa[_0x425d42(0x11a)]['id']}})[_0x425d42(0x19d)](function(_0x550500){const _0x3b0ff1=_0x425d42;if(_0x550500)return _0x550500['setTags'](_0x1077aa[_0x3b0ff1(0x12c)]['ids'],{'through':_[_0x3b0ff1(0x110)](_0x1077aa[_0x3b0ff1(0x12c)],[_0x3b0ff1(0x18a),'id'])})[_0x3b0ff1(0x19d)](function(){const _0x3d998e=_0x3b0ff1;return db[_0x3d998e(0x194)][_0x3d998e(0xe0)]({'attributes':['id',_0x3d998e(0xc4),_0x3d998e(0x120)],'where':{'id':_0x1077aa[_0x3d998e(0x12c)][_0x3d998e(0x18a)]}});})['then'](function(_0x234046){const _0x166631=_0x3b0ff1;return socket['emit'](_0x166631(0x197),{'id':Number(_0x1077aa[_0x166631(0x11a)]['id']),'tags':_0x234046||[]}),{'id':Number(_0x1077aa[_0x166631(0x11a)]['id']),'tags':_0x234046||[]};});})[_0x425d42(0x19d)](respondWithResult(_0xaa0788,null))[_0x425d42(0xdc)](handleError(_0xaa0788,null));},exports[a955_0x4ac46c(0x163)]=function(_0x4edcfe,_0x19393b){const _0xe19d55=a955_0x4ac46c;return db[_0xe19d55(0xda)][_0xe19d55(0x167)]({'where':{'id':_0x4edcfe[_0xe19d55(0x11a)]['id']}})[_0xe19d55(0x19d)](handleEntityNotFound(_0x19393b,null))[_0xe19d55(0x19d)](function(_0x237e94){const _0x537e3c=_0xe19d55;if(_0x237e94)return _0x237e94['removeTags'](_0x4edcfe[_0x537e3c(0xd2)][_0x537e3c(0x18a)]);})[_0xe19d55(0x19d)](respondWithStatusCode(_0x19393b,null))[_0xe19d55(0xdc)](handleError(_0x19393b,null));},exports[a955_0x4ac46c(0x153)]=function(_0x14a25a,_0x5b40d1){const _0x1f20ff=a955_0x4ac46c,_0x28fd0e=moment()[_0x1f20ff(0x132)]()[_0x1f20ff(0xd9)](),_0x41239d=path[_0x1f20ff(0x11f)](config[_0x1f20ff(0x121)],'files','tmp'),_0x2ab6e7=path[_0x1f20ff(0x11f)](config[_0x1f20ff(0x121)],_0x1f20ff(0x170),'attachments'),_0x364230=path[_0x1f20ff(0x11f)](_0x41239d,_0x28fd0e),_0x3cd663=util[_0x1f20ff(0x102)]('transcript-%d-%s.zip',_0x14a25a['params']['id'],_0x28fd0e),_0x416808=path['join'](_0x41239d,_0x3cd663),_0x4a4d8e=[];_0x4a4d8e['push']({'model':db[_0x1f20ff(0x166)],'as':_0x1f20ff(0x166),'attributes':['id',_0x1f20ff(0xdb)],'raw':!![]}),_0x4a4d8e[_0x1f20ff(0xec)]({'model':db[_0x1f20ff(0xca)],'as':'Contact','attributes':['id',_0x1f20ff(0x18e),_0x1f20ff(0x10b)],'raw':!![]});_0x14a25a['query'][_0x1f20ff(0x10e)]&&_0x4a4d8e[_0x1f20ff(0xec)]({'model':db[_0x1f20ff(0x199)],'as':_0x1f20ff(0x199),'raw':!![]});const _0x389eb9=[{'model':db[_0x1f20ff(0x12f)],'as':_0x1f20ff(0x133),'attributes':['id',_0x1f20ff(0x12c),_0x1f20ff(0xfb),'direction',_0x1f20ff(0x10d),_0x1f20ff(0x191)],'include':_0x4a4d8e}];return _0x389eb9[_0x1f20ff(0xec)]({'model':db['WhatsappAccount'],'as':_0x1f20ff(0xc6),'attributes':['id',_0x1f20ff(0xc4)]}),_0x389eb9[_0x1f20ff(0xec)]({'model':db[_0x1f20ff(0x166)],'as':_0x1f20ff(0x131),'attributes':['id',_0x1f20ff(0xdb)]}),db['WhatsappInteraction']['findOne']({'where':{'id':_0x14a25a[_0x1f20ff(0x11a)]['id']},'include':_0x389eb9})[_0x1f20ff(0x19d)](handleEntityNotFound(_0x5b40d1,null))[_0x1f20ff(0x19d)](function(_0x18a701){const _0xf58ae2=_0x1f20ff;if(_0x18a701){const _0x5498f0=_0x18a701[_0xf58ae2(0x146)]({'plain':!![]});fs[_0xf58ae2(0x104)](_0x364230);const _0x15cfe6={'channel':'Whatsapp','account':_0x5498f0['Account'][_0xf58ae2(0xc4)],'agent':_0x5498f0[_0xf58ae2(0x131)]?_0x5498f0[_0xf58ae2(0x131)][_0xf58ae2(0xdb)]:_0xf58ae2(0x184),'createdAt':moment(_0x5498f0['createdAt'])[_0xf58ae2(0x102)](_0xf58ae2(0x145))[_0xf58ae2(0xd9)](),'closedAt':_0x5498f0[_0xf58ae2(0x175)]?moment(_0x5498f0[_0xf58ae2(0xcc)])[_0xf58ae2(0x102)](_0xf58ae2(0x145))['toString']():'','disposition':_0x5498f0[_0xf58ae2(0x125)],'messages':_(_0x5498f0[_0xf58ae2(0x133)])['filter']({'secret':![]})['map'](function(_0x34c04f){const _0x4ac6c2=_0xf58ae2;if(_0x34c04f[_0x4ac6c2(0x199)]){const _0x2aeac1=path['join'](_0x2ab6e7,_0x34c04f[_0x4ac6c2(0x199)]['basename']);fs['existsSync'](_0x2aeac1)&&fs['createReadStream'](_0x2aeac1)[_0x4ac6c2(0xe3)](fs[_0x4ac6c2(0x14f)](path[_0x4ac6c2(0x11f)](_0x364230,_0x34c04f[_0x4ac6c2(0x199)][_0x4ac6c2(0x189)])));}return{'date':moment(_0x34c04f['createdAt'])[_0x4ac6c2(0x102)](_0x4ac6c2(0x145))[_0x4ac6c2(0xd9)](),'sender':_0x34c04f[_0x4ac6c2(0x114)]===_0x4ac6c2(0xf3)?_0x34c04f['User']?_0x34c04f[_0x4ac6c2(0x166)][_0x4ac6c2(0xdb)]:'System':_0x34c04f['Contact'][_0x4ac6c2(0x18e)]+(_0x34c04f['Contact'][_0x4ac6c2(0x10b)]?'\x20'+_0x34c04f[_0x4ac6c2(0x15d)]['lastName']:''),'body':_0x34c04f[_0x4ac6c2(0x199)]?_0x34c04f['Attachment'][_0x4ac6c2(0x189)]:_0x34c04f[_0x4ac6c2(0x12c)],'direction':_0x34c04f['direction']===_0x4ac6c2(0xf3)?'A':'C','secret':_0x34c04f[_0x4ac6c2(0x10d)],'read':_0x34c04f[_0x4ac6c2(0x191)],'attachment':_0x34c04f[_0x4ac6c2(0x199)]};})['value']()};return ejs[_0xf58ae2(0x17d)](path[_0xf58ae2(0x11f)](config['root'],'views','downloadInteraction.ejs'),{'interaction':_0x15cfe6})['then'](async function(_0x444e58){const _0x3ba5b9=_0xf58ae2,_0xcebb5c=path[_0x3ba5b9(0x11f)](_0x364230,_0x3ba5b9(0x10f)+_0x5498f0['id']+'-'+_0x28fd0e+_0x3ba5b9(0x142)),_0x299e2b={'path':_0xcebb5c,'channel':'Whatsapp','interactionId':_0x5498f0['id']};return await createPdfFromHTML(_0x444e58,_0x299e2b),fs[_0x3ba5b9(0x18c)](_0xcebb5c);})[_0xf58ae2(0x19d)](function(){const _0x20db41=_0xf58ae2;return new Promise(function(_0x8db8aa,_0x2ce5b7){zipdir(_0x364230,{'saveTo':_0x416808},function(_0x3f50e9,_0x490b86){if(_0x3f50e9)return _0x2ce5b7(_0x3f50e9);return _0x8db8aa(_0x490b86);});})[_0x20db41(0x19d)](function(){return new Promise(function(_0x378304,_0x12a1ca){rimraf(_0x364230,function(_0x2af9d1){if(_0x2af9d1)_0x12a1ca(_0x2af9d1);return _0x378304();});});})[_0x20db41(0x19d)](function(){const _0x2ef124=_0x20db41;return _0x5b40d1[_0x2ef124(0x153)](_0x416808,_0x3cd663,function(_0xc2746d){const _0xc82879=_0x2ef124;_0xc2746d?consoleLogger[_0xc82879(0xf9)](_0xc82879(0x129),_0xc2746d):fs[_0xc82879(0x12d)](_0x416808);});});});}else return _0x5b40d1['sendStatus'](0xc8);})['catch'](handleError(_0x5b40d1,null));};