Built motion from commit 1fd437e9.|2.6.19
[motion2.git] / server / services / ami / trigger / index.js
index 8e98050..5fb68d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ce=['created','equals','lodash','mustache','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','emit','info','prototype','motionChannel','debug','inspect','interface','checkTriggers','hasOwnProperty','status','merge','variables','Actions','action','contactmanager','motionbar','data1','TemplateId','data2','html','render','template\x20not\x20found','url','uri','buildUri','isNil','data4','location','uriLocation','data5','windowHeight','600','winApplication','winArguments','data3','format','user:%s','name','trigger:%s:%s','toLowerCase','jscripty','trigger:%s','exec','queue','urlforward','parse','search','channel','AllConditions','every','checkConditions','AnyConditions','length','some','checkTrigger:\x20trigger','field','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','event','agent','membername','lastevent','routeId','mailSubstatus','null','substatus','undefined','offlineMessage'];(function(_0x46f4f5,_0x5dc62f){var _0x39458d=function(_0x30fd49){while(--_0x30fd49){_0x46f4f5['push'](_0x46f4f5['shift']());}};_0x39458d(++_0x5dc62f);}(_0xc5ce,0x7d));var _0xec5c=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc5ce[_0x68c979];return _0x4f0001;};'use strict';var util=require('util');var _=require(_0xec5c('0x0'));var url=require('url');var Mustache=require(_0xec5c('0x1'));var Redis=require(_0xec5c('0x2'));var urlforward=require(_0xec5c('0x3'));var integration=require(_0xec5c('0x4'));var cmContact=require(_0xec5c('0x5'));var script=require('./script');var config=require(_0xec5c('0x6'));var logger=require(_0xec5c('0x7'))(_0xec5c('0x8'));var ami=require(_0xec5c('0x9'));config[_0xec5c('0xa')]=_[_0xec5c('0xb')](config[_0xec5c('0xa')],{'host':_0xec5c('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xec5c('0xa')]));var operators={'equals':function(_0x407713,_0x281fa8){return _0x407713==_0x281fa8;},'not_equals':function(_0x236966,_0x214d60){return _0x236966!=_0x214d60;}};var barAndWebActions=[_0xec5c('0xd'),'url',_0xec5c('0xe')];function Trigger(_0x5d0bb3){this[_0xec5c('0xf')]=_0x5d0bb3['triggers'];this[_0xec5c('0x10')]=_0x5d0bb3[_0xec5c('0x10')];this['voiceQueues']=_0x5d0bb3['voiceQueues'];this[_0xec5c('0x11')]=_0x5d0bb3[_0xec5c('0x11')];this['voiceExtensions']=_0x5d0bb3[_0xec5c('0x12')];this['zendeskAccounts']=_0x5d0bb3[_0xec5c('0x13')];this[_0xec5c('0x14')]=_0x5d0bb3[_0xec5c('0x14')];this[_0xec5c('0x15')]=_0x5d0bb3[_0xec5c('0x15')];this[_0xec5c('0x16')]=_0x5d0bb3['sugarcrmAccounts'];this[_0xec5c('0x17')]=_0x5d0bb3['zohoAccounts'];this[_0xec5c('0x18')]=_0x5d0bb3['deskAccounts'];this[_0xec5c('0x19')]=_0x5d0bb3[_0xec5c('0x19')];this[_0xec5c('0x1a')]=_0x5d0bb3[_0xec5c('0x1a')];this[_0xec5c('0x1b')]=_0x5d0bb3[_0xec5c('0x1b')];this[_0xec5c('0x1c')]=_0x5d0bb3[_0xec5c('0x1c')];this[_0xec5c('0x1d')]={'zendesk':this[_0xec5c('0x13')],'salesforce':this[_0xec5c('0x15')],'freshdesk':this[_0xec5c('0x14')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xec5c('0x17')],'desk':this[_0xec5c('0x18')],'vtiger':this[_0xec5c('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0xec5c('0x1c')],'servicenow':this[_0xec5c('0x1a')]};ami['on'](_0xec5c('0x1e'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on']('custom:agentconnect',this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x21'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x22'),this[_0xec5c('0x1f')]['bind'](this));ami['on']('custom:agentnosuchnumber',this['syncCustomEvent'][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x23'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x24'),this['syncCustomEvent'][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x25'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x26'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x27'),this[_0xec5c('0x1f')]['bind'](this));ami['on']('custom:queuecallerabandon',this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x28'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x29'),this['syncAgentDial'][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x2a'),this[_0xec5c('0x2b')][_0xec5c('0x20')](this));ami['on']('custom:dialend',this[_0xec5c('0x2b')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x2c'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x2d'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x2e'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent'][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x2f'),this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on'](_0xec5c('0x30'),this[_0xec5c('0x1f')]['bind'](this));ami['on']('custom:rejectmessage',this[_0xec5c('0x1f')][_0xec5c('0x20')](this));ami['on']('custom:offlineMessage',this[_0xec5c('0x1f')][_0xec5c('0x20')](this));}Trigger['prototype'][_0xec5c('0x31')]=function(_0x17ad7c,_0xc9326d,_0x2bf68b){logger[_0xec5c('0x32')](_0x17ad7c,_0xc9326d,JSON['stringify'](_0x2bf68b));io['to'](_0x17ad7c)[_0xec5c('0x31')](_0xc9326d,_0x2bf68b);};Trigger[_0xec5c('0x33')][_0xec5c('0x1f')]=function(_0x3f50c9){var _0x26fcb9=_['clone'](_0x3f50c9);if(typeof _0x26fcb9[_0xec5c('0x34')]==='undefined'){_0x26fcb9[_0xec5c('0x34')]='voice';}logger[_0xec5c('0x35')](_0xec5c('0x1f'),util[_0xec5c('0x36')](_0x26fcb9,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x26fcb9);};Trigger[_0xec5c('0x33')][_0xec5c('0x2b')]=function(_0x2d94e1){if(this[_0xec5c('0x10')][_0x2d94e1[_0xec5c('0x37')]]){this['syncCustomEvent'](_0x2d94e1);}};Trigger[_0xec5c('0x33')][_0xec5c('0x38')]=function(_0x954779){var _0x13f655;for(var _0x4bd8f3 in this['triggers']){if(this['triggers'][_0xec5c('0x39')](_0x4bd8f3)){if(this['triggers'][_0x4bd8f3][_0xec5c('0x3a')]){_0x13f655=this['checkTrigger'](this[_0xec5c('0xf')][_0x4bd8f3],_0x954779);if(_0x13f655){_[_0xec5c('0x3b')](_0x954779,_0x954779[_0xec5c('0x3c')]);for(var _0x570e7c=0x0,_0x68aa16,_0x17d225,_0x2e766e;_0x570e7c<this[_0xec5c('0xf')][_0x4bd8f3][_0xec5c('0x3d')]['length'];_0x570e7c+=0x1){_0x68aa16=this['triggers'][_0x4bd8f3][_0xec5c('0x3d')][_0x570e7c];if(this[_0xec5c('0x10')][_0x954779[_0xec5c('0x37')]]){switch(_0x68aa16[_0xec5c('0x3e')]['toLowerCase']()){case _0xec5c('0x3f'):break;case _0xec5c('0x40'):case'browser':var _0x532579={};switch(barAndWebActions[_0x68aa16[_0xec5c('0x41')]]){case _0xec5c('0xd'):_0x532579[_0xec5c('0x42')]=_0x68aa16[_0xec5c('0x43')];_0x532579[_0xec5c('0x44')]=this['templates'][_0x68aa16[_0xec5c('0x43')]]?Mustache[_0xec5c('0x45')](this[_0xec5c('0x11')][_0x68aa16[_0xec5c('0x43')]][_0xec5c('0x44')],_0x954779):_0xec5c('0x46');break;case _0xec5c('0x47'):_0x532579[_0xec5c('0x48')]=this[_0xec5c('0x49')](_0x68aa16[_0xec5c('0x43')],_0x954779,_['isNil'](_0x68aa16['data3'])?!![]:parseInt(_0x68aa16['data3'],0xa));if(_[_0xec5c('0x4a')](_0x68aa16[_0xec5c('0x4b')])){_0x532579[_0xec5c('0x4c')]='0';}else{_0x532579[_0xec5c('0x4d')]=_0x68aa16[_0xec5c('0x4b')];_0x532579['windowWidth']=_[_0xec5c('0x4a')](_0x68aa16[_0xec5c('0x4e')])?'800':_0x68aa16[_0xec5c('0x4e')];_0x532579[_0xec5c('0x4f')]=_[_0xec5c('0x4a')](_0x68aa16['data6'])?_0xec5c('0x50'):_0x68aa16['data6'];}break;case _0xec5c('0xe'):_0x532579[_0xec5c('0x51')]=_0x68aa16[_0xec5c('0x43')]?Mustache['render'](_0x68aa16['data2'],_0x954779):'';_0x532579[_0xec5c('0x52')]=_0x68aa16[_0xec5c('0x53')]?Mustache['render'](_0x68aa16[_0xec5c('0x53')],_0x954779):'';break;}this[_0xec5c('0x31')](util[_0xec5c('0x54')](_0xec5c('0x55'),this['agents'][_0x954779['interface']][_0xec5c('0x56')]),util[_0xec5c('0x54')](_0xec5c('0x57'),_0x68aa16['action'][_0xec5c('0x58')](),barAndWebActions[_0x68aa16['data1']]),_[_0xec5c('0x3b')](_0x532579,_0x954779));break;case _0xec5c('0x59'):this[_0xec5c('0x31')](util[_0xec5c('0x54')](_0xec5c('0x55'),this[_0xec5c('0x10')][_0x954779[_0xec5c('0x37')]][_0xec5c('0x56')]),util[_0xec5c('0x54')](_0xec5c('0x5a'),_0x68aa16[_0xec5c('0x3e')][_0xec5c('0x58')]()),_[_0xec5c('0x3b')]({'ProjectId':parseInt(_0x68aa16[_0xec5c('0x41')],0xa)},_0x954779));break;default:this[_0xec5c('0x31')](util[_0xec5c('0x54')](_0xec5c('0x55'),this[_0xec5c('0x10')][_0x954779[_0xec5c('0x37')]]['name']),util[_0xec5c('0x54')](_0xec5c('0x5a'),_0x68aa16[_0xec5c('0x3e')][_0xec5c('0x58')]()),_[_0xec5c('0x3b')]({},_0x68aa16,_0x954779));}}switch(_0x68aa16[_0xec5c('0x3e')][_0xec5c('0x58')]()){case _0xec5c('0x3f'):cmContact[_0xec5c('0x5b')](this[_0xec5c('0x10')][_0x954779[_0xec5c('0x37')]],this[_0xec5c('0xf')][_0x4bd8f3],_0x68aa16,_0x954779);break;case'integration':integration[_0xec5c('0x5b')](_0x68aa16,_0x954779,this[_0xec5c('0x1d')],this[_0xec5c('0x10')][_0x954779[_0xec5c('0x37')]],this['voiceQueues'][_0x954779[_0xec5c('0x5c')]],this['voiceExtensions'][_0x954779['routeId']]);break;case _0xec5c('0x5d'):urlforward[_0xec5c('0x5b')](_0x68aa16,_0x954779);break;case'script':script[_0xec5c('0x5b')](_0x68aa16,_0x954779);break;}}}}}}};Trigger['prototype']['buildUri']=function(_0x5140e1,_0xfb2603,_0x2bc7e7){var _0x2ee5ad=url[_0xec5c('0x5e')](Mustache[_0xec5c('0x45')](_0x5140e1,_0xfb2603),!![]);if(_0x2bc7e7){_[_0xec5c('0x3b')](_0x2ee5ad['query'],_0xfb2603);}delete _0x2ee5ad[_0xec5c('0x5f')];var _0x59cb36=url[_0xec5c('0x54')](_0x2ee5ad);_0x59cb36=_0x59cb36['replace'](/\/\?/g,'?');return _0x59cb36;};Trigger[_0xec5c('0x33')]['checkTrigger']=function(_0x231602,_0x19b935){var _0x53b6e8=!![];var _0xfe782b=!![];var _0xf31c07=![];if(_0x231602[_0xec5c('0x60')]===_0x19b935[_0xec5c('0x34')]){_0xf31c07=!![];}if(_0x231602[_0xec5c('0x61')]['length']){_0x53b6e8=_[_0xec5c('0x62')](_0x231602[_0xec5c('0x61')],this[_0xec5c('0x63')](_0x19b935,_0x231602['channel']));}if(_0x231602[_0xec5c('0x64')][_0xec5c('0x65')]){_0xfe782b=_[_0xec5c('0x66')](_0x231602['AnyConditions'],this[_0xec5c('0x63')](_0x19b935,_0x231602[_0xec5c('0x60')]));}var _0x1ef0b0=_0xf31c07&&_0x53b6e8&&_0xfe782b;logger[_0xec5c('0x35')](_0xec5c('0x67'),util[_0xec5c('0x36')](_0x231602,{'showHidden':!![],'depth':null}),'evt',util[_0xec5c('0x36')](_0x19b935,{'showHidden':!![],'depth':null}),_0xf31c07,_0x53b6e8,_0xfe782b);return _0x1ef0b0;};Trigger[_0xec5c('0x33')][_0xec5c('0x63')]=function(_0x488698,_0x221523){return function(_0x4badb8){switch(_0x4badb8[_0xec5c('0x68')]){case'account':if(_0x488698[_0xec5c('0x60')]===_0x221523){if(_0x221523==='chat'){return _0x488698['ChatWebsiteId']?operators[_0x4badb8[_0xec5c('0x69')]](Number(_0x4badb8[_0xec5c('0x6a')]),_0x488698[_0xec5c('0x6b')]):![];}else{return _0x488698[_[_0xec5c('0x6c')](_0x221523)+'AccountId']?operators[_0x4badb8[_0xec5c('0x69')]](Number(_0x4badb8[_0xec5c('0x6a')]),_0x488698[_[_0xec5c('0x6c')](_0x221523)+_0xec5c('0x6d')]):![];}}break;case _0xec5c('0x6e'):case'message':if(_0x488698[_0xec5c('0x60')]===_0x221523){return _0x488698[_0xec5c('0x6f')]?operators[_0x4badb8[_0xec5c('0x69')]](_0x4badb8[_0xec5c('0x6a')],_0x488698[_0xec5c('0x6f')]):![];}break;case _0xec5c('0x5c'):return _0x488698['queue']?operators[_0x4badb8[_0xec5c('0x69')]](_0x4badb8[_0xec5c('0x6a')],_0x488698[_0xec5c('0x5c')]):![];case _0xec5c('0x70'):return _0x488698[_0xec5c('0x71')]?operators[_0x4badb8['operator']](_0x4badb8[_0xec5c('0x6a')],_0x488698[_0xec5c('0x71')]):![];case'lastevent':return _0x488698[_0xec5c('0x72')]?operators[_0x4badb8[_0xec5c('0x69')]](_0x4badb8[_0xec5c('0x6a')],_0x488698['lastevent']):![];case'routeId':return _0x488698['routeId']?operators[_0x4badb8[_0xec5c('0x69')]](_0x4badb8[_0xec5c('0x6a')],_0x488698[_0xec5c('0x73')]):![];case _0xec5c('0x74'):if(_0x4badb8[_0xec5c('0x6a')]===_0xec5c('0x75'))_0x4badb8[_0xec5c('0x6a')]=null;return typeof _0x488698[_0xec5c('0x76')]!==_0xec5c('0x77')?operators[_0x4badb8['operator']](_0x4badb8[_0xec5c('0x6a')],_0x488698[_0xec5c('0x76')]):![];case _0xec5c('0x78'):if(_0x488698['channel']===_0x221523){return _0x4badb8['value']===_0xec5c('0x79')&&_0x4badb8[_0xec5c('0x69')]===_0xec5c('0x7a')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0xe83c=['urlforward','script','parse','query','replace','channel','every','AllConditions','checkConditions','some','AnyConditions','debug','checkTrigger:\x20trigger','evt','account','chat','ChatWebsiteId','operator','AccountId','value','interaction','message','event','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','ioredis','./urlforward','./cmContact','./script','../../../config/logger','trigger','../ami','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','salesforceAccounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:substatus','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify','motionChannel','undefined','inspect','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','data2','template\x20not\x20found','buildUri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','600','winApplication','render','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','accounts','queue'];(function(_0x3c3c27,_0x2f06f0){var _0x118caa=function(_0x53ce8e){while(--_0x53ce8e){_0x3c3c27['push'](_0x3c3c27['shift']());}};_0x118caa(++_0x2f06f0);}(_0xe83c,0x1a6));var _0xce83=function(_0x13f980,_0x1e1c56){_0x13f980=_0x13f980-0x0;var _0x27153c=_0xe83c[_0x13f980];return _0x27153c;};'use strict';var util=require(_0xce83('0x0'));var _=require(_0xce83('0x1'));var url=require(_0xce83('0x2'));var Mustache=require('mustache');var Redis=require(_0xce83('0x3'));var urlforward=require(_0xce83('0x4'));var integration=require('./integration');var cmContact=require(_0xce83('0x5'));var script=require(_0xce83('0x6'));var config=require('../../../config/environment');var logger=require(_0xce83('0x7'))(_0xce83('0x8'));var ami=require(_0xce83('0x9'));config[_0xce83('0xa')]=_['defaults'](config[_0xce83('0xa')],{'host':_0xce83('0xb'),'port':0x18eb});var io=require(_0xce83('0xc'))(new Redis(config[_0xce83('0xa')]));var operators={'equals':function(_0x349105,_0x29b141){return _0x349105==_0x29b141;},'not_equals':function(_0x6db6d2,_0x6ff439){return _0x6db6d2!=_0x6ff439;}};var barAndWebActions=[_0xce83('0xd'),_0xce83('0x2'),_0xce83('0xe')];function Trigger(_0x23f837){this[_0xce83('0xf')]=_0x23f837[_0xce83('0xf')];this[_0xce83('0x10')]=_0x23f837[_0xce83('0x10')];this[_0xce83('0x11')]=_0x23f837[_0xce83('0x11')];this[_0xce83('0x12')]=_0x23f837['templates'];this[_0xce83('0x13')]=_0x23f837[_0xce83('0x13')];this[_0xce83('0x14')]=_0x23f837['zendeskAccounts'];this['freshdeskAccounts']=_0x23f837[_0xce83('0x15')];this['salesforceAccounts']=_0x23f837['salesforceAccounts'];this[_0xce83('0x16')]=_0x23f837['sugarcrmAccounts'];this[_0xce83('0x17')]=_0x23f837[_0xce83('0x17')];this[_0xce83('0x18')]=_0x23f837[_0xce83('0x18')];this[_0xce83('0x19')]=_0x23f837[_0xce83('0x19')];this['servicenowAccounts']=_0x23f837['servicenowAccounts'];this[_0xce83('0x1a')]=_0x23f837[_0xce83('0x1a')];this[_0xce83('0x1b')]=_0x23f837[_0xce83('0x1b')];this['accounts']={'zendesk':this[_0xce83('0x14')],'salesforce':this[_0xce83('0x1c')],'freshdesk':this[_0xce83('0x15')],'sugarcrm':this[_0xce83('0x16')],'zoho':this[_0xce83('0x17')],'desk':this['deskAccounts'],'vtiger':this[_0xce83('0x19')],'dynamics365':this[_0xce83('0x1a')],'freshsales':this[_0xce83('0x1b')],'servicenow':this[_0xce83('0x1d')]};ami['on'](_0xce83('0x1e'),this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on'](_0xce83('0x21'),this[_0xce83('0x1f')]['bind'](this));ami['on'](_0xce83('0x22'),this[_0xce83('0x1f')]['bind'](this));ami['on'](_0xce83('0x23'),this['syncCustomEvent'][_0xce83('0x20')](this));ami['on'](_0xce83('0x24'),this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on'](_0xce83('0x25'),this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on'](_0xce83('0x26'),this['syncCustomEvent'][_0xce83('0x20')](this));ami['on'](_0xce83('0x27'),this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on'](_0xce83('0x28'),this['syncCustomEvent'][_0xce83('0x20')](this));ami['on'](_0xce83('0x29'),this['syncCustomEvent'][_0xce83('0x20')](this));ami['on'](_0xce83('0x2a'),this[_0xce83('0x1f')]['bind'](this));ami['on'](_0xce83('0x2b'),this['syncCustomEvent'][_0xce83('0x20')](this));ami['on'](_0xce83('0x2c'),this[_0xce83('0x2d')][_0xce83('0x20')](this));ami['on'](_0xce83('0x2e'),this[_0xce83('0x2d')][_0xce83('0x20')](this));ami['on'](_0xce83('0x2f'),this[_0xce83('0x2d')][_0xce83('0x20')](this));ami['on']('custom:newinteraction',this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on']('custom:closedinteraction',this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on'](_0xce83('0x30'),this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on']('custom:incomingmessage',this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on'](_0xce83('0x31'),this['syncCustomEvent'][_0xce83('0x20')](this));ami['on']('custom:acceptmessage',this[_0xce83('0x1f')][_0xce83('0x20')](this));ami['on'](_0xce83('0x32'),this['syncCustomEvent'][_0xce83('0x20')](this));ami['on']('custom:offlineMessage',this[_0xce83('0x1f')]['bind'](this));}Trigger[_0xce83('0x33')][_0xce83('0x34')]=function(_0x2be6a0,_0x3419af,_0x2c12cd){logger[_0xce83('0x35')](_0x2be6a0,_0x3419af,JSON[_0xce83('0x36')](_0x2c12cd));io['to'](_0x2be6a0)[_0xce83('0x34')](_0x3419af,_0x2c12cd);};Trigger['prototype'][_0xce83('0x1f')]=function(_0xd81add){var _0x2eb631=_['clone'](_0xd81add);if(typeof _0x2eb631[_0xce83('0x37')]===_0xce83('0x38')){_0x2eb631['motionChannel']='voice';}logger['debug']('syncCustomEvent',util[_0xce83('0x39')](_0x2eb631,{'showHidden':!![],'depth':null}));this[_0xce83('0x3a')](_0x2eb631);};Trigger['prototype']['syncAgentDial']=function(_0xc509f5){if(this[_0xce83('0x10')][_0xc509f5[_0xce83('0x3b')]]){this['syncCustomEvent'](_0xc509f5);}};Trigger[_0xce83('0x33')][_0xce83('0x3a')]=function(_0x1ce00c){var _0x291ae6;for(var _0x2ec6e7 in this[_0xce83('0xf')]){if(this[_0xce83('0xf')][_0xce83('0x3c')](_0x2ec6e7)){if(this[_0xce83('0xf')][_0x2ec6e7][_0xce83('0x3d')]){_0x291ae6=this[_0xce83('0x3e')](this[_0xce83('0xf')][_0x2ec6e7],_0x1ce00c);if(_0x291ae6){_[_0xce83('0x3f')](_0x1ce00c,_0x1ce00c['variables']);for(var _0xe82afc=0x0,_0x1c7341,_0x2bbe9c,_0x5d5c2d;_0xe82afc<this[_0xce83('0xf')][_0x2ec6e7][_0xce83('0x40')][_0xce83('0x41')];_0xe82afc+=0x1){_0x1c7341=this['triggers'][_0x2ec6e7][_0xce83('0x40')][_0xe82afc];if(this[_0xce83('0x10')][_0x1ce00c[_0xce83('0x3b')]]){switch(_0x1c7341[_0xce83('0x42')][_0xce83('0x43')]()){case _0xce83('0x44'):break;case _0xce83('0x45'):case _0xce83('0x46'):var _0xf68d64={};switch(barAndWebActions[_0x1c7341[_0xce83('0x47')]]){case'popup':_0xf68d64['TemplateId']=_0x1c7341[_0xce83('0x48')];_0xf68d64['html']=this['templates'][_0x1c7341['data2']]?Mustache['render'](this[_0xce83('0x12')][_0x1c7341['data2']]['html'],_0x1ce00c):_0xce83('0x49');break;case _0xce83('0x2'):_0xf68d64['uri']=this[_0xce83('0x4a')](_0x1c7341[_0xce83('0x48')],_0x1ce00c,_[_0xce83('0x4b')](_0x1c7341[_0xce83('0x4c')])?!![]:parseInt(_0x1c7341[_0xce83('0x4c')],0xa));if(_['isNil'](_0x1c7341[_0xce83('0x4d')])){_0xf68d64[_0xce83('0x4e')]='0';}else{_0xf68d64['uriLocation']=_0x1c7341[_0xce83('0x4d')];_0xf68d64[_0xce83('0x4f')]=_[_0xce83('0x4b')](_0x1c7341[_0xce83('0x50')])?_0xce83('0x51'):_0x1c7341[_0xce83('0x50')];_0xf68d64[_0xce83('0x52')]=_[_0xce83('0x4b')](_0x1c7341[_0xce83('0x53')])?_0xce83('0x54'):_0x1c7341[_0xce83('0x53')];}break;case _0xce83('0xe'):_0xf68d64[_0xce83('0x55')]=_0x1c7341[_0xce83('0x48')]?Mustache[_0xce83('0x56')](_0x1c7341[_0xce83('0x48')],_0x1ce00c):'';_0xf68d64[_0xce83('0x57')]=_0x1c7341[_0xce83('0x4c')]?Mustache[_0xce83('0x56')](_0x1c7341[_0xce83('0x4c')],_0x1ce00c):'';break;}this[_0xce83('0x34')](util[_0xce83('0x58')](_0xce83('0x59'),this['agents'][_0x1ce00c['interface']][_0xce83('0x5a')]),util[_0xce83('0x58')](_0xce83('0x5b'),_0x1c7341['action'][_0xce83('0x43')](),barAndWebActions[_0x1c7341['data1']]),_[_0xce83('0x3f')](_0xf68d64,_0x1ce00c));break;case _0xce83('0x5c'):this[_0xce83('0x34')](util[_0xce83('0x58')](_0xce83('0x59'),this[_0xce83('0x10')][_0x1ce00c[_0xce83('0x3b')]][_0xce83('0x5a')]),util[_0xce83('0x58')](_0xce83('0x5d'),_0x1c7341['action']['toLowerCase']()),_['merge']({'ProjectId':parseInt(_0x1c7341[_0xce83('0x47')],0xa)},_0x1ce00c));break;default:this[_0xce83('0x34')](util[_0xce83('0x58')](_0xce83('0x59'),this[_0xce83('0x10')][_0x1ce00c['interface']]['name']),util[_0xce83('0x58')](_0xce83('0x5d'),_0x1c7341[_0xce83('0x42')][_0xce83('0x43')]()),_[_0xce83('0x3f')]({},_0x1c7341,_0x1ce00c));}}switch(_0x1c7341[_0xce83('0x42')]['toLowerCase']()){case _0xce83('0x44'):cmContact[_0xce83('0x5e')](this[_0xce83('0x10')][_0x1ce00c[_0xce83('0x3b')]],this['triggers'][_0x2ec6e7],_0x1c7341,_0x1ce00c);break;case _0xce83('0x5f'):integration[_0xce83('0x5e')](_0x1c7341,_0x1ce00c,this[_0xce83('0x60')],this[_0xce83('0x10')][_0x1ce00c['interface']],this['voiceQueues'][_0x1ce00c[_0xce83('0x61')]],this[_0xce83('0x13')][_0x1ce00c['routeId']]);break;case _0xce83('0x62'):urlforward[_0xce83('0x5e')](_0x1c7341,_0x1ce00c);break;case _0xce83('0x63'):script[_0xce83('0x5e')](_0x1c7341,_0x1ce00c);break;}}}}}}};Trigger[_0xce83('0x33')]['buildUri']=function(_0x265ca0,_0x45106e,_0x47d85e){var _0x1a9eb3=url[_0xce83('0x64')](Mustache[_0xce83('0x56')](_0x265ca0,_0x45106e),!![]);if(_0x47d85e){_[_0xce83('0x3f')](_0x1a9eb3[_0xce83('0x65')],_0x45106e);}delete _0x1a9eb3['search'];var _0x5bcdb4=url['format'](_0x1a9eb3);_0x5bcdb4=_0x5bcdb4[_0xce83('0x66')](/\/\?/g,'?');return _0x5bcdb4;};Trigger[_0xce83('0x33')][_0xce83('0x3e')]=function(_0x547a63,_0x80c129){var _0x399f49=!![];var _0x4565a1=!![];var _0x516864=![];if(_0x547a63[_0xce83('0x67')]===_0x80c129[_0xce83('0x37')]){_0x516864=!![];}if(_0x547a63['AllConditions'][_0xce83('0x41')]){_0x399f49=_[_0xce83('0x68')](_0x547a63[_0xce83('0x69')],this[_0xce83('0x6a')](_0x80c129,_0x547a63['channel']));}if(_0x547a63['AnyConditions'][_0xce83('0x41')]){_0x4565a1=_[_0xce83('0x6b')](_0x547a63[_0xce83('0x6c')],this[_0xce83('0x6a')](_0x80c129,_0x547a63['channel']));}var _0x4c238a=_0x516864&&_0x399f49&&_0x4565a1;logger[_0xce83('0x6d')](_0xce83('0x6e'),util[_0xce83('0x39')](_0x547a63,{'showHidden':!![],'depth':null}),_0xce83('0x6f'),util[_0xce83('0x39')](_0x80c129,{'showHidden':!![],'depth':null}),_0x516864,_0x399f49,_0x4565a1);return _0x4c238a;};Trigger[_0xce83('0x33')][_0xce83('0x6a')]=function(_0x4154f7,_0x580004){return function(_0xb54f2c){switch(_0xb54f2c['field']){case _0xce83('0x70'):if(_0x4154f7['channel']===_0x580004){if(_0x580004===_0xce83('0x71')){return _0x4154f7[_0xce83('0x72')]?operators[_0xb54f2c[_0xce83('0x73')]](Number(_0xb54f2c['value']),_0x4154f7[_0xce83('0x72')]):![];}else{return _0x4154f7[_['upperFirst'](_0x580004)+_0xce83('0x74')]?operators[_0xb54f2c[_0xce83('0x73')]](Number(_0xb54f2c[_0xce83('0x75')]),_0x4154f7[_['upperFirst'](_0x580004)+'AccountId']):![];}}break;case _0xce83('0x76'):case _0xce83('0x77'):if(_0x4154f7['channel']===_0x580004){return _0x4154f7['event']?operators[_0xb54f2c['operator']](_0xb54f2c['value'],_0x4154f7[_0xce83('0x78')]):![];}break;case'queue':return _0x4154f7[_0xce83('0x61')]?operators[_0xb54f2c[_0xce83('0x73')]](_0xb54f2c[_0xce83('0x75')],_0x4154f7[_0xce83('0x61')]):![];case'agent':return _0x4154f7['membername']?operators[_0xb54f2c[_0xce83('0x73')]](_0xb54f2c[_0xce83('0x75')],_0x4154f7[_0xce83('0x79')]):![];case _0xce83('0x7a'):return _0x4154f7[_0xce83('0x7a')]?operators[_0xb54f2c[_0xce83('0x73')]](_0xb54f2c[_0xce83('0x75')],_0x4154f7[_0xce83('0x7a')]):![];case'routeId':return _0x4154f7['routeId']?operators[_0xb54f2c[_0xce83('0x73')]](_0xb54f2c['value'],_0x4154f7['routeId']):![];case _0xce83('0x7b'):if(_0xb54f2c[_0xce83('0x75')]===_0xce83('0x7c'))_0xb54f2c['value']=null;return typeof _0x4154f7['substatus']!==_0xce83('0x38')?operators[_0xb54f2c['operator']](_0xb54f2c['value'],_0x4154f7[_0xce83('0x7d')]):![];case _0xce83('0x7e'):if(_0x4154f7[_0xce83('0x67')]===_0x580004){return _0xb54f2c[_0xce83('0x75')]===_0xce83('0x7f')&&_0xb54f2c[_0xce83('0x73')]===_0xce83('0x80')?!![]:![];}break;}return![];};};module[_0xce83('0x81')]=Trigger;
\ No newline at end of file