Built motion from commit 6362bb75.|2.6.13
[motion2.git] / server / services / ami / trigger / index.js
index 25d1b76..fae8b34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7144=['trigger','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','accounts','vtigerAccounts','dynamics365Accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','checkTriggers','interface','checkTrigger','merge','Actions','length','motionbar','browser','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winApplication','render','format','user:%s','name','trigger:%s:%s','action','toLowerCase','trigger:%s','data1','exec','routeId','urlforward','script','parse','query','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','some','debug','checkTrigger:\x20trigger','inspect','evt','field','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','event','queue','agent','membername','lastevent','mailSubstatus','null','substatus','exports','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger'];(function(_0x48dfc7,_0x28410f){var _0x553cbf=function(_0x56f3f7){while(--_0x56f3f7){_0x48dfc7['push'](_0x48dfc7['shift']());}};_0x553cbf(++_0x28410f);}(_0x7144,0x77));var _0x4714=function(_0x3abfcf,_0x4a6cb6){_0x3abfcf=_0x3abfcf-0x0;var _0x175b7b=_0x7144[_0x3abfcf];return _0x175b7b;};'use strict';var util=require(_0x4714('0x0'));var _=require(_0x4714('0x1'));var url=require(_0x4714('0x2'));var Mustache=require('mustache');var Redis=require(_0x4714('0x3'));var urlforward=require(_0x4714('0x4'));var integration=require(_0x4714('0x5'));var cmContact=require(_0x4714('0x6'));var script=require(_0x4714('0x7'));var config=require(_0x4714('0x8'));var logger=require(_0x4714('0x9'))(_0x4714('0xa'));var ami=require('../ami');config['redis']=_[_0x4714('0xb')](config[_0x4714('0xc')],{'host':_0x4714('0xd'),'port':0x18eb});var io=require(_0x4714('0xe'))(new Redis(config[_0x4714('0xc')]));var operators={'equals':function(_0x213194,_0x21f6a8){return _0x213194==_0x21f6a8;},'not_equals':function(_0x2ea0cb,_0x3ada1f){return _0x2ea0cb!=_0x3ada1f;}};var barAndWebActions=[_0x4714('0xf'),_0x4714('0x2'),_0x4714('0x10')];function Trigger(_0x38a3d6){this[_0x4714('0x11')]=_0x38a3d6['triggers'];this['agents']=_0x38a3d6[_0x4714('0x12')];this[_0x4714('0x13')]=_0x38a3d6[_0x4714('0x13')];this[_0x4714('0x14')]=_0x38a3d6[_0x4714('0x14')];this[_0x4714('0x15')]=_0x38a3d6[_0x4714('0x15')];this[_0x4714('0x16')]=_0x38a3d6[_0x4714('0x16')];this[_0x4714('0x17')]=_0x38a3d6[_0x4714('0x17')];this[_0x4714('0x18')]=_0x38a3d6[_0x4714('0x18')];this[_0x4714('0x19')]=_0x38a3d6[_0x4714('0x19')];this['zohoAccounts']=_0x38a3d6[_0x4714('0x1a')];this[_0x4714('0x1b')]=_0x38a3d6[_0x4714('0x1b')];this['vtigerAccounts']=_0x38a3d6['vtigerAccounts'];this[_0x4714('0x1c')]=_0x38a3d6[_0x4714('0x1c')];this['dynamics365Accounts']=_0x38a3d6['dynamics365Accounts'];this['freshsalesAccounts']=_0x38a3d6[_0x4714('0x1d')];this[_0x4714('0x1e')]={'zendesk':this[_0x4714('0x16')],'salesforce':this[_0x4714('0x18')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x4714('0x19')],'zoho':this[_0x4714('0x1a')],'desk':this['deskAccounts'],'vtiger':this[_0x4714('0x1f')],'dynamics365':this[_0x4714('0x20')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0x4714('0x21'),this[_0x4714('0x22')]['bind'](this));ami['on'](_0x4714('0x23'),this[_0x4714('0x22')]['bind'](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x4714('0x24')](this));ami['on'](_0x4714('0x25'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on'](_0x4714('0x26'),this['syncCustomEvent'][_0x4714('0x24')](this));ami['on'](_0x4714('0x27'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x4714('0x24')](this));ami['on'](_0x4714('0x28'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on']('custom:agentreject',this[_0x4714('0x22')]['bind'](this));ami['on'](_0x4714('0x29'),this['syncCustomEvent'][_0x4714('0x24')](this));ami['on'](_0x4714('0x2a'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on'](_0x4714('0x2b'),this[_0x4714('0x22')]['bind'](this));ami['on'](_0x4714('0x2c'),this[_0x4714('0x2d')]['bind'](this));ami['on']('custom:dialconnect',this[_0x4714('0x2d')][_0x4714('0x24')](this));ami['on'](_0x4714('0x2e'),this[_0x4714('0x2d')][_0x4714('0x24')](this));ami['on'](_0x4714('0x2f'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on']('custom:closedinteraction',this['syncCustomEvent'][_0x4714('0x24')](this));ami['on'](_0x4714('0x30'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on'](_0x4714('0x31'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on'](_0x4714('0x32'),this[_0x4714('0x22')][_0x4714('0x24')](this));ami['on'](_0x4714('0x33'),this['syncCustomEvent'][_0x4714('0x24')](this));ami['on'](_0x4714('0x34'),this['syncCustomEvent']['bind'](this));ami['on'](_0x4714('0x35'),this[_0x4714('0x22')]['bind'](this));}Trigger[_0x4714('0x36')][_0x4714('0x37')]=function(_0x5388eb,_0x29ca2f,_0x583d58){logger['info'](_0x5388eb,_0x29ca2f,JSON[_0x4714('0x38')](_0x583d58));io['to'](_0x5388eb)['emit'](_0x29ca2f,_0x583d58);};Trigger[_0x4714('0x36')][_0x4714('0x22')]=function(_0x27047d){var _0x1d6b72=_[_0x4714('0x39')](_0x27047d);if(typeof _0x1d6b72[_0x4714('0x3a')]===_0x4714('0x3b')){_0x1d6b72[_0x4714('0x3a')]=_0x4714('0x3c');}logger['debug']('syncCustomEvent',util['inspect'](_0x1d6b72,{'showHidden':!![],'depth':null}));this[_0x4714('0x3d')](_0x1d6b72);};Trigger['prototype']['syncAgentDial']=function(_0x49b66a){if(this[_0x4714('0x12')][_0x49b66a[_0x4714('0x3e')]]){this[_0x4714('0x22')](_0x49b66a);}};Trigger[_0x4714('0x36')]['checkTriggers']=function(_0x51bfde){var _0x1fb855;for(var _0x3b4fdb in this[_0x4714('0x11')]){if(this[_0x4714('0x11')]['hasOwnProperty'](_0x3b4fdb)){if(this[_0x4714('0x11')][_0x3b4fdb]['status']){_0x1fb855=this[_0x4714('0x3f')](this[_0x4714('0x11')][_0x3b4fdb],_0x51bfde);if(_0x1fb855){_[_0x4714('0x40')](_0x51bfde,_0x51bfde['variables']);for(var _0x2604fb=0x0,_0x30abfc,_0x330783,_0x162271;_0x2604fb<this[_0x4714('0x11')][_0x3b4fdb][_0x4714('0x41')][_0x4714('0x42')];_0x2604fb+=0x1){_0x30abfc=this[_0x4714('0x11')][_0x3b4fdb]['Actions'][_0x2604fb];if(this[_0x4714('0x12')][_0x51bfde[_0x4714('0x3e')]]){switch(_0x30abfc['action']['toLowerCase']()){case'contactmanager':break;case _0x4714('0x43'):case _0x4714('0x44'):var _0x502706={};switch(barAndWebActions[_0x30abfc['data1']]){case _0x4714('0xf'):_0x502706[_0x4714('0x45')]=_0x30abfc[_0x4714('0x46')];_0x502706['html']=this['templates'][_0x30abfc[_0x4714('0x46')]]?Mustache['render'](this[_0x4714('0x14')][_0x30abfc[_0x4714('0x46')]][_0x4714('0x47')],_0x51bfde):_0x4714('0x48');break;case _0x4714('0x2'):_0x502706[_0x4714('0x49')]=this[_0x4714('0x4a')](_0x30abfc['data2'],_0x51bfde,_[_0x4714('0x4b')](_0x30abfc[_0x4714('0x4c')])?!![]:parseInt(_0x30abfc['data3'],0xa));if(_[_0x4714('0x4b')](_0x30abfc[_0x4714('0x4d')])){_0x502706[_0x4714('0x4e')]='0';}else{_0x502706[_0x4714('0x4f')]=_0x30abfc[_0x4714('0x4d')];_0x502706[_0x4714('0x50')]=_[_0x4714('0x4b')](_0x30abfc[_0x4714('0x51')])?_0x4714('0x52'):_0x30abfc['data5'];_0x502706[_0x4714('0x53')]=_[_0x4714('0x4b')](_0x30abfc[_0x4714('0x54')])?'600':_0x30abfc['data6'];}break;case _0x4714('0x10'):_0x502706[_0x4714('0x55')]=_0x30abfc[_0x4714('0x46')]?Mustache[_0x4714('0x56')](_0x30abfc['data2'],_0x51bfde):'';_0x502706['winArguments']=_0x30abfc[_0x4714('0x4c')]?Mustache[_0x4714('0x56')](_0x30abfc[_0x4714('0x4c')],_0x51bfde):'';break;}this[_0x4714('0x37')](util[_0x4714('0x57')](_0x4714('0x58'),this[_0x4714('0x12')][_0x51bfde['interface']][_0x4714('0x59')]),util[_0x4714('0x57')](_0x4714('0x5a'),_0x30abfc[_0x4714('0x5b')][_0x4714('0x5c')](),barAndWebActions[_0x30abfc['data1']]),_['merge'](_0x502706,_0x51bfde));break;case'jscripty':this['emit'](util['format'](_0x4714('0x58'),this['agents'][_0x51bfde[_0x4714('0x3e')]][_0x4714('0x59')]),util[_0x4714('0x57')](_0x4714('0x5d'),_0x30abfc[_0x4714('0x5b')][_0x4714('0x5c')]()),_[_0x4714('0x40')]({'ProjectId':parseInt(_0x30abfc[_0x4714('0x5e')],0xa)},_0x51bfde));break;default:this[_0x4714('0x37')](util[_0x4714('0x57')](_0x4714('0x58'),this[_0x4714('0x12')][_0x51bfde[_0x4714('0x3e')]][_0x4714('0x59')]),util[_0x4714('0x57')](_0x4714('0x5d'),_0x30abfc['action'][_0x4714('0x5c')]()),_['merge']({},_0x30abfc,_0x51bfde));}}switch(_0x30abfc[_0x4714('0x5b')][_0x4714('0x5c')]()){case'contactmanager':cmContact[_0x4714('0x5f')](this[_0x4714('0x12')][_0x51bfde[_0x4714('0x3e')]],this[_0x4714('0x11')][_0x3b4fdb],_0x30abfc,_0x51bfde);break;case'integration':integration['exec'](_0x30abfc,_0x51bfde,this['accounts'],this[_0x4714('0x12')][_0x51bfde['interface']],this['voiceQueues'][_0x51bfde['queue']],this[_0x4714('0x15')][_0x51bfde[_0x4714('0x60')]]);break;case _0x4714('0x61'):urlforward['exec'](_0x30abfc,_0x51bfde);break;case _0x4714('0x62'):script[_0x4714('0x5f')](_0x30abfc,_0x51bfde);break;}}}}}}};Trigger['prototype'][_0x4714('0x4a')]=function(_0x3dae34,_0x436a36,_0x4c02b7){var _0x2a8723=url[_0x4714('0x63')](Mustache[_0x4714('0x56')](_0x3dae34,_0x436a36),!![]);if(_0x4c02b7){_[_0x4714('0x40')](_0x2a8723[_0x4714('0x64')],_0x436a36);}delete _0x2a8723[_0x4714('0x65')];var _0x24ca4a=url[_0x4714('0x57')](_0x2a8723);_0x24ca4a=_0x24ca4a[_0x4714('0x66')](/\/\?/g,'?');return _0x24ca4a;};Trigger['prototype'][_0x4714('0x3f')]=function(_0x3d23f9,_0x519b82){var _0x5b30c7=!![];var _0xc69cd9=!![];var _0x4a47ae=![];if(_0x3d23f9[_0x4714('0x67')]===_0x519b82['motionChannel']){_0x4a47ae=!![];}if(_0x3d23f9['AllConditions'][_0x4714('0x42')]){_0x5b30c7=_[_0x4714('0x68')](_0x3d23f9[_0x4714('0x69')],this[_0x4714('0x6a')](_0x519b82,_0x3d23f9[_0x4714('0x67')]));}if(_0x3d23f9[_0x4714('0x6b')]['length']){_0xc69cd9=_[_0x4714('0x6c')](_0x3d23f9[_0x4714('0x6b')],this['checkConditions'](_0x519b82,_0x3d23f9[_0x4714('0x67')]));}var _0x5b1ca6=_0x4a47ae&&_0x5b30c7&&_0xc69cd9;logger[_0x4714('0x6d')](_0x4714('0x6e'),util[_0x4714('0x6f')](_0x3d23f9,{'showHidden':!![],'depth':null}),_0x4714('0x70'),util[_0x4714('0x6f')](_0x519b82,{'showHidden':!![],'depth':null}),_0x4a47ae,_0x5b30c7,_0xc69cd9);return _0x5b1ca6;};Trigger['prototype']['checkConditions']=function(_0x51dd27,_0x51a6de){return function(_0xd12fa7){switch(_0xd12fa7[_0x4714('0x71')]){case'account':if(_0x51dd27[_0x4714('0x67')]===_0x51a6de){if(_0x51a6de==='chat'){return _0x51dd27[_0x4714('0x72')]?operators[_0xd12fa7['operator']](Number(_0xd12fa7[_0x4714('0x73')]),_0x51dd27['ChatWebsiteId']):![];}else{return _0x51dd27[_[_0x4714('0x74')](_0x51a6de)+_0x4714('0x75')]?operators[_0xd12fa7[_0x4714('0x76')]](Number(_0xd12fa7['value']),_0x51dd27[_['upperFirst'](_0x51a6de)+_0x4714('0x75')]):![];}}break;case _0x4714('0x77'):case'message':if(_0x51dd27[_0x4714('0x67')]===_0x51a6de){return _0x51dd27['event']?operators[_0xd12fa7['operator']](_0xd12fa7['value'],_0x51dd27[_0x4714('0x78')]):![];}break;case _0x4714('0x79'):return _0x51dd27['queue']?operators[_0xd12fa7[_0x4714('0x76')]](_0xd12fa7[_0x4714('0x73')],_0x51dd27[_0x4714('0x79')]):![];case _0x4714('0x7a'):return _0x51dd27[_0x4714('0x7b')]?operators[_0xd12fa7[_0x4714('0x76')]](_0xd12fa7[_0x4714('0x73')],_0x51dd27[_0x4714('0x7b')]):![];case'lastevent':return _0x51dd27[_0x4714('0x7c')]?operators[_0xd12fa7['operator']](_0xd12fa7[_0x4714('0x73')],_0x51dd27[_0x4714('0x7c')]):![];case _0x4714('0x60'):return _0x51dd27[_0x4714('0x60')]?operators[_0xd12fa7[_0x4714('0x76')]](_0xd12fa7[_0x4714('0x73')],_0x51dd27[_0x4714('0x60')]):![];case _0x4714('0x7d'):if(_0xd12fa7[_0x4714('0x73')]===_0x4714('0x7e'))_0xd12fa7[_0x4714('0x73')]=null;return typeof _0x51dd27[_0x4714('0x7f')]!==_0x4714('0x3b')?operators[_0xd12fa7['operator']](_0xd12fa7[_0x4714('0x73')],_0x51dd27[_0x4714('0x7f')]):![];case'offlineMessage':if(_0x51dd27['channel']===_0x51a6de){return _0xd12fa7['value']==='created'&&_0xd12fa7[_0x4714('0x76')]==='equals'?!![]:![];}break;}return![];};};module[_0x4714('0x80')]=Trigger;
\ No newline at end of file
+var _0xf52b=['replace','AllConditions','every','checkConditions','channel','length','some','AnyConditions','debug','checkTrigger:\x20trigger','evt','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/logger','../ami','defaults','redis','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','syncCustomEvent','custom:agentnosuchnumber','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','motionChannel','undefined','voice','inspect','checkTriggers','status','checkTrigger','merge','Actions','interface','toLowerCase','contactmanager','motionbar','data1','TemplateId','data2','html','render','buildUri','isNil','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','format','user:%s','name','trigger:%s:%s','action','trigger:%s','exec','integration','queue','script','parse','search'];(function(_0x1c8bef,_0x12825f){var _0x4ad852=function(_0x6357e5){while(--_0x6357e5){_0x1c8bef['push'](_0x1c8bef['shift']());}};_0x4ad852(++_0x12825f);}(_0xf52b,0x119));var _0xbf52=function(_0x8afdd0,_0x548ad1){_0x8afdd0=_0x8afdd0-0x0;var _0x3de7ac=_0xf52b[_0x8afdd0];return _0x3de7ac;};'use strict';var util=require(_0xbf52('0x0'));var _=require(_0xbf52('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require(_0xbf52('0x2'));var urlforward=require(_0xbf52('0x3'));var integration=require(_0xbf52('0x4'));var cmContact=require(_0xbf52('0x5'));var script=require(_0xbf52('0x6'));var config=require('../../../config/environment');var logger=require(_0xbf52('0x7'))('trigger');var ami=require(_0xbf52('0x8'));config['redis']=_[_0xbf52('0x9')](config[_0xbf52('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x255dd4,_0xdaac6d){return _0x255dd4==_0xdaac6d;},'not_equals':function(_0x2af609,_0x36cce1){return _0x2af609!=_0x36cce1;}};var barAndWebActions=[_0xbf52('0xb'),_0xbf52('0xc'),_0xbf52('0xd')];function Trigger(_0x3cd186){this[_0xbf52('0xe')]=_0x3cd186[_0xbf52('0xe')];this['agents']=_0x3cd186[_0xbf52('0xf')];this[_0xbf52('0x10')]=_0x3cd186[_0xbf52('0x10')];this[_0xbf52('0x11')]=_0x3cd186['templates'];this['voiceExtensions']=_0x3cd186[_0xbf52('0x12')];this[_0xbf52('0x13')]=_0x3cd186[_0xbf52('0x13')];this[_0xbf52('0x14')]=_0x3cd186['freshdeskAccounts'];this[_0xbf52('0x15')]=_0x3cd186[_0xbf52('0x15')];this[_0xbf52('0x16')]=_0x3cd186[_0xbf52('0x16')];this[_0xbf52('0x17')]=_0x3cd186['zohoAccounts'];this[_0xbf52('0x18')]=_0x3cd186[_0xbf52('0x18')];this[_0xbf52('0x19')]=_0x3cd186[_0xbf52('0x19')];this[_0xbf52('0x1a')]=_0x3cd186[_0xbf52('0x1a')];this[_0xbf52('0x1b')]=_0x3cd186[_0xbf52('0x1b')];this[_0xbf52('0x1c')]=_0x3cd186['freshsalesAccounts'];this[_0xbf52('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xbf52('0x15')],'freshdesk':this[_0xbf52('0x14')],'sugarcrm':this[_0xbf52('0x16')],'zoho':this['zohoAccounts'],'desk':this[_0xbf52('0x18')],'vtiger':this[_0xbf52('0x19')],'dynamics365':this[_0xbf52('0x1b')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xbf52('0x1a')]};ami['on'](_0xbf52('0x1e'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on']('custom:agentconnect',this[_0xbf52('0x20')][_0xbf52('0x1f')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcomplete',this[_0xbf52('0x20')][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x21'),this[_0xbf52('0x20')][_0xbf52('0x1f')](this));ami['on']('custom:agentnoanswer',this[_0xbf52('0x20')][_0xbf52('0x1f')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x22'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x23'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x24'),this[_0xbf52('0x20')][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x25'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on']('custom:dialbegin',this[_0xbf52('0x26')]['bind'](this));ami['on'](_0xbf52('0x27'),this['syncAgentDial'][_0xbf52('0x1f')](this));ami['on']('custom:dialend',this[_0xbf52('0x26')]['bind'](this));ami['on'](_0xbf52('0x28'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x29'),this[_0xbf52('0x20')]['bind'](this));ami['on'](_0xbf52('0x2a'),this[_0xbf52('0x20')]['bind'](this));ami['on'](_0xbf52('0x2b'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x2c'),this[_0xbf52('0x20')][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x2d'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on'](_0xbf52('0x2e'),this['syncCustomEvent'][_0xbf52('0x1f')](this));ami['on']('custom:offlineMessage',this[_0xbf52('0x20')]['bind'](this));}Trigger[_0xbf52('0x2f')][_0xbf52('0x30')]=function(_0x46c89c,_0x2394ba,_0x38531c){logger[_0xbf52('0x31')](_0x46c89c,_0x2394ba,JSON['stringify'](_0x38531c));io['to'](_0x46c89c)[_0xbf52('0x30')](_0x2394ba,_0x38531c);};Trigger[_0xbf52('0x2f')]['syncCustomEvent']=function(_0x21184d){var _0x35d286=_['clone'](_0x21184d);if(typeof _0x35d286[_0xbf52('0x32')]===_0xbf52('0x33')){_0x35d286['motionChannel']=_0xbf52('0x34');}logger['debug'](_0xbf52('0x20'),util[_0xbf52('0x35')](_0x35d286,{'showHidden':!![],'depth':null}));this[_0xbf52('0x36')](_0x35d286);};Trigger[_0xbf52('0x2f')][_0xbf52('0x26')]=function(_0x473d7d){if(this[_0xbf52('0xf')][_0x473d7d['interface']]){this[_0xbf52('0x20')](_0x473d7d);}};Trigger[_0xbf52('0x2f')][_0xbf52('0x36')]=function(_0xbd3224){var _0x586bef;for(var _0x11f212 in this[_0xbf52('0xe')]){if(this['triggers']['hasOwnProperty'](_0x11f212)){if(this['triggers'][_0x11f212][_0xbf52('0x37')]){_0x586bef=this[_0xbf52('0x38')](this['triggers'][_0x11f212],_0xbd3224);if(_0x586bef){_[_0xbf52('0x39')](_0xbd3224,_0xbd3224['variables']);for(var _0x339157=0x0,_0x2b58e2,_0x5c5716,_0x4174ed;_0x339157<this[_0xbf52('0xe')][_0x11f212][_0xbf52('0x3a')]['length'];_0x339157+=0x1){_0x2b58e2=this[_0xbf52('0xe')][_0x11f212]['Actions'][_0x339157];if(this[_0xbf52('0xf')][_0xbd3224[_0xbf52('0x3b')]]){switch(_0x2b58e2['action'][_0xbf52('0x3c')]()){case _0xbf52('0x3d'):break;case _0xbf52('0x3e'):case'browser':var _0x155d85={};switch(barAndWebActions[_0x2b58e2[_0xbf52('0x3f')]]){case'popup':_0x155d85[_0xbf52('0x40')]=_0x2b58e2[_0xbf52('0x41')];_0x155d85[_0xbf52('0x42')]=this[_0xbf52('0x11')][_0x2b58e2[_0xbf52('0x41')]]?Mustache[_0xbf52('0x43')](this[_0xbf52('0x11')][_0x2b58e2[_0xbf52('0x41')]][_0xbf52('0x42')],_0xbd3224):'template\x20not\x20found';break;case _0xbf52('0xc'):_0x155d85['uri']=this[_0xbf52('0x44')](_0x2b58e2[_0xbf52('0x41')],_0xbd3224,_[_0xbf52('0x45')](_0x2b58e2['data3'])?!![]:parseInt(_0x2b58e2['data3'],0xa));if(_[_0xbf52('0x45')](_0x2b58e2[_0xbf52('0x46')])){_0x155d85['location']='0';}else{_0x155d85[_0xbf52('0x47')]=_0x2b58e2[_0xbf52('0x46')];_0x155d85[_0xbf52('0x48')]=_[_0xbf52('0x45')](_0x2b58e2[_0xbf52('0x49')])?_0xbf52('0x4a'):_0x2b58e2[_0xbf52('0x49')];_0x155d85[_0xbf52('0x4b')]=_[_0xbf52('0x45')](_0x2b58e2[_0xbf52('0x4c')])?_0xbf52('0x4d'):_0x2b58e2[_0xbf52('0x4c')];}break;case _0xbf52('0xd'):_0x155d85[_0xbf52('0x4e')]=_0x2b58e2[_0xbf52('0x41')]?Mustache['render'](_0x2b58e2[_0xbf52('0x41')],_0xbd3224):'';_0x155d85['winArguments']=_0x2b58e2['data3']?Mustache['render'](_0x2b58e2['data3'],_0xbd3224):'';break;}this[_0xbf52('0x30')](util[_0xbf52('0x4f')](_0xbf52('0x50'),this['agents'][_0xbd3224[_0xbf52('0x3b')]][_0xbf52('0x51')]),util[_0xbf52('0x4f')](_0xbf52('0x52'),_0x2b58e2[_0xbf52('0x53')][_0xbf52('0x3c')](),barAndWebActions[_0x2b58e2[_0xbf52('0x3f')]]),_[_0xbf52('0x39')](_0x155d85,_0xbd3224));break;case'jscripty':this[_0xbf52('0x30')](util[_0xbf52('0x4f')](_0xbf52('0x50'),this[_0xbf52('0xf')][_0xbd3224[_0xbf52('0x3b')]]['name']),util[_0xbf52('0x4f')]('trigger:%s',_0x2b58e2[_0xbf52('0x53')]['toLowerCase']()),_[_0xbf52('0x39')]({'ProjectId':parseInt(_0x2b58e2[_0xbf52('0x3f')],0xa)},_0xbd3224));break;default:this[_0xbf52('0x30')](util[_0xbf52('0x4f')](_0xbf52('0x50'),this[_0xbf52('0xf')][_0xbd3224[_0xbf52('0x3b')]][_0xbf52('0x51')]),util[_0xbf52('0x4f')](_0xbf52('0x54'),_0x2b58e2[_0xbf52('0x53')][_0xbf52('0x3c')]()),_[_0xbf52('0x39')]({},_0x2b58e2,_0xbd3224));}}switch(_0x2b58e2[_0xbf52('0x53')][_0xbf52('0x3c')]()){case'contactmanager':cmContact[_0xbf52('0x55')](this[_0xbf52('0xf')][_0xbd3224[_0xbf52('0x3b')]],this[_0xbf52('0xe')][_0x11f212],_0x2b58e2,_0xbd3224);break;case _0xbf52('0x56'):integration[_0xbf52('0x55')](_0x2b58e2,_0xbd3224,this[_0xbf52('0x1d')],this[_0xbf52('0xf')][_0xbd3224[_0xbf52('0x3b')]],this[_0xbf52('0x10')][_0xbd3224[_0xbf52('0x57')]],this[_0xbf52('0x12')][_0xbd3224['routeId']]);break;case'urlforward':urlforward[_0xbf52('0x55')](_0x2b58e2,_0xbd3224);break;case _0xbf52('0x58'):script[_0xbf52('0x55')](_0x2b58e2,_0xbd3224);break;}}}}}}};Trigger[_0xbf52('0x2f')][_0xbf52('0x44')]=function(_0x283964,_0xca1940,_0x1eda4f){var _0x5f3f64=url[_0xbf52('0x59')](Mustache[_0xbf52('0x43')](_0x283964,_0xca1940),!![]);if(_0x1eda4f){_['merge'](_0x5f3f64['query'],_0xca1940);}delete _0x5f3f64[_0xbf52('0x5a')];var _0x53da10=url[_0xbf52('0x4f')](_0x5f3f64);_0x53da10=_0x53da10[_0xbf52('0x5b')](/\/\?/g,'?');return _0x53da10;};Trigger[_0xbf52('0x2f')][_0xbf52('0x38')]=function(_0x5e6a90,_0x49fa13){var _0x3cf0b5=!![];var _0x183445=!![];var _0xace143=![];if(_0x5e6a90['channel']===_0x49fa13['motionChannel']){_0xace143=!![];}if(_0x5e6a90[_0xbf52('0x5c')]['length']){_0x3cf0b5=_[_0xbf52('0x5d')](_0x5e6a90[_0xbf52('0x5c')],this[_0xbf52('0x5e')](_0x49fa13,_0x5e6a90[_0xbf52('0x5f')]));}if(_0x5e6a90['AnyConditions'][_0xbf52('0x60')]){_0x183445=_[_0xbf52('0x61')](_0x5e6a90[_0xbf52('0x62')],this[_0xbf52('0x5e')](_0x49fa13,_0x5e6a90[_0xbf52('0x5f')]));}var _0x519134=_0xace143&&_0x3cf0b5&&_0x183445;logger[_0xbf52('0x63')](_0xbf52('0x64'),util['inspect'](_0x5e6a90,{'showHidden':!![],'depth':null}),_0xbf52('0x65'),util[_0xbf52('0x35')](_0x49fa13,{'showHidden':!![],'depth':null}),_0xace143,_0x3cf0b5,_0x183445);return _0x519134;};Trigger[_0xbf52('0x2f')][_0xbf52('0x5e')]=function(_0x3bdaec,_0x4143ba){return function(_0x450b76){switch(_0x450b76[_0xbf52('0x66')]){case _0xbf52('0x67'):if(_0x3bdaec[_0xbf52('0x5f')]===_0x4143ba){if(_0x4143ba===_0xbf52('0x68')){return _0x3bdaec[_0xbf52('0x69')]?operators[_0x450b76[_0xbf52('0x6a')]](Number(_0x450b76[_0xbf52('0x6b')]),_0x3bdaec['ChatWebsiteId']):![];}else{return _0x3bdaec[_[_0xbf52('0x6c')](_0x4143ba)+_0xbf52('0x6d')]?operators[_0x450b76[_0xbf52('0x6a')]](Number(_0x450b76[_0xbf52('0x6b')]),_0x3bdaec[_[_0xbf52('0x6c')](_0x4143ba)+_0xbf52('0x6d')]):![];}}break;case _0xbf52('0x6e'):case _0xbf52('0x6f'):if(_0x3bdaec[_0xbf52('0x5f')]===_0x4143ba){return _0x3bdaec['event']?operators[_0x450b76['operator']](_0x450b76[_0xbf52('0x6b')],_0x3bdaec[_0xbf52('0x70')]):![];}break;case _0xbf52('0x57'):return _0x3bdaec[_0xbf52('0x57')]?operators[_0x450b76[_0xbf52('0x6a')]](_0x450b76[_0xbf52('0x6b')],_0x3bdaec[_0xbf52('0x57')]):![];case _0xbf52('0x71'):return _0x3bdaec['membername']?operators[_0x450b76['operator']](_0x450b76['value'],_0x3bdaec[_0xbf52('0x72')]):![];case'lastevent':return _0x3bdaec['lastevent']?operators[_0x450b76[_0xbf52('0x6a')]](_0x450b76[_0xbf52('0x6b')],_0x3bdaec[_0xbf52('0x73')]):![];case _0xbf52('0x74'):return _0x3bdaec[_0xbf52('0x74')]?operators[_0x450b76[_0xbf52('0x6a')]](_0x450b76[_0xbf52('0x6b')],_0x3bdaec[_0xbf52('0x74')]):![];case _0xbf52('0x75'):if(_0x450b76[_0xbf52('0x6b')]===_0xbf52('0x76'))_0x450b76[_0xbf52('0x6b')]=null;return typeof _0x3bdaec[_0xbf52('0x77')]!==_0xbf52('0x33')?operators[_0x450b76[_0xbf52('0x6a')]](_0x450b76[_0xbf52('0x6b')],_0x3bdaec[_0xbf52('0x77')]):![];case _0xbf52('0x78'):if(_0x3bdaec['channel']===_0x4143ba){return _0x450b76[_0xbf52('0x6b')]===_0xbf52('0x79')&&_0x450b76[_0xbf52('0x6a')]===_0xbf52('0x7a')?!![]:![];}break;}return![];};};module[_0xbf52('0x7b')]=Trigger;
\ No newline at end of file