Built motion from commit a5685af.|0.0.128
[motion.git] / server / config / integrations / zendesk.js
1 var _0xc776=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x5A\x65\x6E\x64\x65\x73\x6B\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x5A\x65\x6E\x64\x65\x73\x6B\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x45\x78\x74\x65\x6E\x73\x69\x6F\x6E","\x5A\x65\x6E\x64\x65\x73\x6B\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x68\x61\x6E\x64\x6C\x65\x45\x76\x65\x6E\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x50\x61\x73\x73\x65\x64\x20\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x73\x20\x61\x72\x65\x20\x6E\x6F\x74\x20\x65\x6E\x6F\x75\x67\x68\x20\x74\x6F\x20\x63\x72\x65\x61\x74\x65\x20\x61\x20\x6E\x65\x77\x20\x74\x69\x63\x6B\x65\x74\x3A\x20\x6D\x69\x73\x73\x20\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64\x20\x6F\x72\x20\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E\x49\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x66\x69\x6E\x64","\x63\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x75\x72\x69","\x68\x65\x61\x64\x65\x72\x73","\x73\x65\x72\x76\x65\x72\x55\x52\x4C","\x73\x65\x72\x76\x65\x72\x55\x72\x6C","\x5A\x65\x6E\x64\x65\x73\x6B\x41\x63\x63\x6F\x75\x6E\x74","\x71\x75\x65\x75\x65","\x6E\x61\x6D\x65","\x6D\x6F\x6E\x69\x74\x6F\x72\x5F\x66\x6F\x72\x6D\x61\x74","\x66\x69\x6E\x64\x4F\x6E\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x65\x6E\x61\x62\x6C\x65\x64\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x51\x75\x65\x75\x65","\x72\x65\x63\x6F\x72\x64\x45\x6E\x61\x62\x6C\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x51\x75\x65\x75\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x20\x6F\x72\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x6E\x6F\x74\x20\x65\x6E\x61\x62\x6C\x65\x64","\x72\x6F\x75\x74\x65\x49\x64","\x69\x64","\x72\x65\x63\x6F\x72\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x65\x6E\x61\x62\x6C\x65\x64\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x52\x6F\x75\x74\x65\x20\x4F\x75\x74\x62\x6F\x75\x6E\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x52\x6F\x75\x74\x65\x20\x4F\x75\x74\x62\x6F\x75\x6E\x64\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x20\x6F\x72\x20\x52\x65\x63\x6F\x72\x64\x69\x6E\x67\x20\x6E\x6F\x74\x20\x65\x6E\x61\x62\x6C\x65\x64","\x72\x65\x6D\x6F\x74\x65\x55\x72\x69","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x61\x75\x74\x68\x54\x79\x70\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x3A","\x74\x6F\x6B\x65\x6E","\x2F\x74\x6F\x6B\x65\x6E\x3A","\x41\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E","\x42\x61\x73\x69\x63\x20","\x62\x61\x73\x65\x36\x34","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x67\x65\x6E\x74\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x2F\x73\x65\x61\x72\x63\x68\x2E\x6A\x73\x6F\x6E","\x74\x79\x70\x65\x3A\x75\x73\x65\x72\x20\x72\x6F\x6C\x65\x3A\x61\x67\x65\x6E\x74\x20\x6E\x61\x6D\x65\x3A\x25\x73","\x66\x6F\x72\x6D\x61\x74","","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x76\x6F\x69\x63\x65","\x43\x68\x61\x6E\x6E\x65\x6C\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64\x3A","\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x55\x52\x4C","\x25\x73\x2F\x61\x70\x69\x2F\x76\x6F\x69\x63\x65\x2F\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x73\x2F\x25\x73\x2F\x64\x6F\x77\x6E\x6C\x6F\x61\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x72\x65\x73\x75\x6C\x74","\x6C\x65\x6E\x67\x74\x68","\x72\x65\x73\x75\x6C\x74\x73","\x63\x6F\x75\x6E\x74","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x67\x65\x6E\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x61\x67\x65\x6E\x74","\x66\x69\x72\x73\x74","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x67\x65\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2E\x20\x55\x73\x65\x20\x74\x68\x65\x20\x61\x64\x6D\x69\x6E\x20\x61\x63\x63\x6F\x75\x6E\x74","\x2F\x75\x73\x65\x72\x73\x2F\x6D\x65\x2E\x6A\x73\x6F\x6E","\x75\x73\x65\x72","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x41\x64\x6D\x69\x6E\x20\x73\x65\x6C\x65\x63\x74\x65\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x74\x79\x70\x65\x3A\x75\x73\x65\x72\x20\x72\x6F\x6C\x65\x3A\x65\x6E\x64\x2D\x75\x73\x65\x72\x20\x25\x73\x3A\x25\x73","\x70\x68\x6F\x6E\x65","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x66\x6F\x75\x6E\x64\x3A","\x65\x6E\x64\x75\x73\x65\x72","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x2F\x75\x73\x65\x72\x73\x2E\x6A\x73\x6F\x6E","\x50\x4F\x53\x54","\x65\x6E\x64\x2D\x75\x73\x65\x72","\x43\x61\x6C\x6C\x65\x72\x20\x2D\x20\x25\x73","\x3C\x75\x6E\x6B\x6E\x6F\x77\x6E\x3E","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x6E\x64\x20\x55\x73\x65\x72\x20\x63\x72\x65\x61\x74\x65\x64\x3A","\x76\x61\x6C\x75\x65","\x66\x6F\x72\x45\x61\x63\x68","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x54\x69\x63\x6B\x65\x74\x20\x62\x6F\x64\x79\x3A","\x2F\x74\x69\x63\x6B\x65\x74\x73\x2E\x6A\x73\x6F\x6E","\x54\x61\x67\x73","\x6D\x61\x70","\x53\x75\x62\x6A\x65\x63\x74","\x73\x6F\x72\x74\x42\x79","\x74\x79\x70\x65","\x73\x74\x72\x69\x6E\x67","\x63\x6F\x6E\x74\x65\x6E\x74","\x70\x75\x73\x68","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x72\x69\x61\x62\x6C\x65\x4E\x61\x6D\x65","\x63\x75\x73\x74\x6F\x6D\x56\x61\x72\x69\x61\x62\x6C\x65","\x56\x61\x72\x69\x61\x62\x6C\x65","\x20","\x6A\x6F\x69\x6E","\x44\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x6B\x65\x79\x56\x61\x6C\x75\x65","\x6B\x65\x79\x54\x79\x70\x65","\x25\x73\x3A\x20\x25\x73","\x6B\x65\x79","\x6B\x65\x79\x43\x6F\x6E\x74\x65\x6E\x74","\x0A","\x46\x69\x65\x6C\x64","\x66\x69\x6C\x74\x65\x72","\x69\x64\x46\x69\x65\x6C\x64","\x6E\x61\x6D\x65\x46\x69\x65\x6C\x64","\x74\x69\x63\x6B\x65\x74","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x54\x69\x63\x6B\x65\x74\x20\x63\x72\x65\x61\x74\x65\x64","\x2F\x63\x68\x61\x6E\x6E\x65\x6C\x73\x2F\x76\x6F\x69\x63\x65\x2F\x61\x67\x65\x6E\x74\x73\x2F\x25\x64\x2F\x74\x69\x63\x6B\x65\x74\x73\x2F\x25\x64\x2F\x64\x69\x73\x70\x6C\x61\x79\x2E\x6A\x73\x6F\x6E","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x7A\x65\x6E\x64\x65\x73\x6B","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x65\x78\x69\x74\x53\x74\x61\x74\x75\x73","\x73\x75\x63\x63\x65\x73\x73","\x74\x69\x63\x6B\x65\x74\x49\x64","\x75\x72\x6C","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64","\x63\x72\x65\x61\x74\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x54\x69\x63\x6B\x65\x74\x20\x25\x64\x20\x64\x69\x73\x70\x6C\x61\x79\x65\x64\x20\x74\x6F\x20\x61\x67\x65\x6E\x74\x20\x25\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x74\x69\x63\x6B\x65\x74\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x6D\x65\x73\x73\x61\x67\x65","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\x66\x61\x69\x6C\x65\x64","\x5B\x5A\x65\x6E\x64\x65\x73\x6B\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x52\x65\x70\x6F\x72\x74\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x20\x63\x72\x65\x61\x74\x65","\x73\x75\x62\x73\x74\x72","\x2F","\x65\x78\x70\x6F\x72\x74\x73"];_0xc776[0];var _=require(_0xc776[1]);var util=require(_0xc776[2]);var rp=require(_0xc776[3]);var ZendeskIntegration=require(_0xc776[5])[_0xc776[4]];var ZendeskConfiguration=require(_0xc776[5])[_0xc776[6]];var ReportIntegration=require(_0xc776[5])[_0xc776[7]];var VoiceQueue=require(_0xc776[5])[_0xc776[8]];var VoiceExtension=require(_0xc776[5])[_0xc776[9]];function Zendesk(){console[_0xc776[11]](_0xc776[10])}Zendesk[_0xc776[13]][_0xc776[12]]= function(_0xce7fxa,_0xce7fxb,_0xce7fxc,_0xce7fxd,_0xce7fxe,_0xce7fxf){var _0xce7fx10={uri:undefined,headers:undefined,agent:undefined,enduser:undefined,ticket:undefined,configuration:undefined,recordEnable:false,serverURL:undefined};if(!_0xce7fxa||  !_0xce7fxb){console[_0xc776[15]](_0xc776[14]);return};ZendeskConfiguration[_0xc776[18]]({where:{id:_0xce7fxb,AccountId:_0xce7fxa},include:[{all:true,include:[{all:true}]}]})[_0xc776[17]](handleEntityNotFound())[_0xc776[17]](handleConnection(_0xce7fx10))[_0xc776[17]](searchQueue(_0xce7fxe))[_0xc776[17]](handleQueueRecordings(_0xce7fx10))[_0xc776[17]](searchRoute(_0xce7fxe))[_0xc776[17]](handleOutboundRecordings(_0xce7fx10))[_0xc776[17]](searchAgent(_0xce7fx10,_0xce7fxc,_0xce7fxe))[_0xc776[17]](handleAgent(_0xce7fx10,_0xce7fxc,_0xce7fxe))[_0xc776[17]](searchAdmin(_0xce7fx10))[_0xc776[17]](handleAdmin(_0xce7fx10))[_0xc776[17]](searchEndUser(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxd))[_0xc776[17]](handleEndUser(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxd))[_0xc776[17]](endUserCreation(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxd))[_0xc776[17]](handleEndUserCreation(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxd))[_0xc776[17]](ticketCreation(_0xce7fx10,_0xce7fxe,_0xce7fxf))[_0xc776[17]](handleTicketDisplay(_0xce7fx10))[_0xc776[17]](handleReportIntegration(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxa))[_0xc776[17]](handleEnd(_0xce7fx10))[_0xc776[16]](handleError(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxa))};function handleEntityNotFound(){return function(_0xce7fx12){if(!_0xce7fx12){return null};return _0xce7fx12}}function handleConnection(_0xce7fx10){return function(_0xce7fx14){var _0xce7fx15=getAccountConfiguration(_0xce7fx14.ZendeskAccount);_0xce7fx10[_0xc776[19]]= _0xce7fx14;_0xce7fx10[_0xc776[20]]= _0xce7fx15[_0xc776[20]];_0xce7fx10[_0xc776[21]]= _0xce7fx15[_0xc776[21]];_0xce7fx10[_0xc776[22]]= _0xce7fx14[_0xc776[24]][_0xc776[23]]}}function searchQueue(_0xce7fxe){return function(){if(_0xce7fxe[_0xc776[25]]){return VoiceQueue[_0xc776[28]]({where:{name:_0xce7fxe[_0xc776[25]]},attributes:[_0xc776[26],_0xc776[27]]})}else {return}}}function handleQueueRecordings(_0xce7fx10){return function(_0xce7fx18){if(_0xce7fx18&& _0xce7fx18[_0xc776[27]]){console[_0xc776[11]](_0xc776[29],_0xce7fx18[_0xc776[26]]);_0xce7fx10[_0xc776[30]]= true}else {_0xce7fx10[_0xc776[30]]= false;console[_0xc776[11]](_0xc776[31]);return}}}function searchRoute(_0xce7fxe){return function(){if(_0xce7fxe[_0xc776[32]]){return VoiceExtension[_0xc776[28]]({where:{id:_0xce7fxe[_0xc776[32]]},attributes:[_0xc776[33],_0xc776[34]]})}else {return}}}function handleOutboundRecordings(_0xce7fx10){return function(_0xce7fx1b){if(_0xce7fx1b&& _0xce7fx1b[_0xc776[34]]){console[_0xc776[11]](_0xc776[35],_0xce7fx1b[_0xc776[33]]);_0xce7fx10[_0xc776[30]]= true}else {_0xce7fx10[_0xc776[30]]= false;console[_0xc776[11]](_0xc776[36]);return}}}function getAccountConfiguration(_0xce7fx1d){var _0xce7fx1e={uri:stripTrailingSlash(_0xce7fx1d[_0xc776[37]]),headers:{"\x41\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E":undefined,"\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65":_0xc776[38],"\x41\x63\x63\x65\x70\x74":_0xc776[38]}};var _0xce7fx1f=_0xce7fx1d[_0xc776[39]];if(_0xce7fx1d[_0xc776[40]]=== _0xc776[41]){_0xce7fx1f= _0xce7fx1f+ _0xc776[42]+ _0xce7fx1d[_0xc776[41]]}else {if(_0xce7fx1d[_0xc776[40]]=== _0xc776[43]){_0xce7fx1f= _0xce7fx1f+ _0xc776[44]+ _0xce7fx1d[_0xc776[43]]}};_0xce7fx1e[_0xc776[21]][_0xc776[45]]= _0xc776[46]+  new Buffer(_0xce7fx1f).toString(_0xc776[47]);return _0xce7fx1e}function searchAgent(_0xce7fx10,_0xce7fxc,_0xce7fxe){return function(){console[_0xc776[11]](_0xc776[48],getValueFromPropertyName(_0xce7fxe,getAgentSearchPropertyFromChannel(_0xce7fxc)));return rp({uri:_0xce7fx10[_0xc776[20]]+ _0xc776[49],qs:{"\x71\x75\x65\x72\x79":util[_0xc776[51]](_0xc776[50],getValueFromPropertyName(_0xce7fxe,getAgentSearchPropertyFromChannel(_0xce7fxc)))},headers:_0xce7fx10[_0xc776[21]],json:true})}}function getAgentSearchPropertyFromChannel(_0xce7fxc){var _0xce7fx22=_0xc776[52];if(_0xce7fxc){switch(_0xce7fxc){case _0xc776[54]:_0xce7fx22= _0xc776[53];break;default:_0xce7fx22= _0xc776[53];console[_0xc776[15]](_0xc776[55],_0xce7fxc)}};return _0xce7fx22}function getValueFromPropertyName(_0xce7fxe,_0xce7fx22,_0xce7fx10){if(_0xce7fx22=== _0xc776[56]){if(_0xce7fx10&& _0xce7fx10[_0xc776[30]]&& _0xce7fx10[_0xc776[22]]){return util[_0xc776[51]](_0xc776[57],stripTrailingSlash(_0xce7fx10[_0xc776[22]]),_0xce7fxe[_0xc776[58]])}else {return null}}else {return _[_0xc776[59]](_0xce7fxe,_0xce7fx22)}}function handleAgent(_0xce7fx10,_0xce7fxc,_0xce7fx25){return function(_0xce7fxe){if(_0xce7fxe[_0xc776[61]][_0xc776[60]]> 0&& _0xce7fxe[_0xc776[62]]> 0){console[_0xc776[11]](_0xc776[63],getValueFromPropertyName(_0xce7fx25,getAgentSearchPropertyFromChannel(_0xce7fxc)));_0xce7fx10[_0xc776[64]]= getMatchObject(_0xce7fxe[_0xc776[61]],_0xc776[26],getValueFromPropertyName(_0xce7fx25,getAgentSearchPropertyFromChannel(_0xce7fxc)));return _0xce7fx10[_0xc776[64]]};return}}function getMatchObject(_0xce7fx27,_0xce7fx22,_0xce7fx28){var _0xce7fx29=_[_0xc776[18]](_0xce7fx27,{property:_0xce7fx28});if(_0xce7fx29){return _0xce7fx29};return _[_0xc776[65]](_0xce7fx27)}function searchAdmin(_0xce7fx10){return function(_0xce7fxe){if(_0xce7fxe){return};console[_0xc776[11]](_0xc776[66]);return rp({uri:_0xce7fx10[_0xc776[20]]+ _0xc776[67],headers:_0xce7fx10[_0xc776[21]],json:true})}}function handleAdmin(_0xce7fx10){return function(_0xce7fxe){if(!_0xce7fxe){return};if(_0xce7fxe[_0xc776[68]]){console[_0xc776[11]](_0xc776[69]);_0xce7fx10[_0xc776[64]]= _0xce7fxe[_0xc776[68]]};return}}function searchEndUser(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxd){return function(){console[_0xc776[11]](_0xc776[70],getValueFromPropertyName(_0xce7fxe,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd)));return rp({uri:_0xce7fx10[_0xc776[20]]+ _0xc776[49],qs:{"\x71\x75\x65\x72\x79":util[_0xc776[51]](_0xc776[71],getEndUserSearchQueryFromChannel(_0xce7fxc),getValueFromPropertyName(_0xce7fxe,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd)))},headers:_0xce7fx10[_0xc776[21]],json:true})}}function getEndUserSearchQueryFromChannel(_0xce7fxc){var _0xce7fx22=_0xc776[52];if(_0xce7fxc){switch(_0xce7fxc){case _0xc776[54]:_0xce7fx22= _0xc776[72];break;default:_0xce7fx22= _0xc776[72];console[_0xc776[15]](_0xc776[55],_0xce7fxc)}};return _0xce7fx22}function getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd){var _0xce7fx22=_0xc776[52];if(_0xce7fxc){switch(_0xce7fxc){case _0xc776[54]:if(_0xce7fxd=== _0xc776[73]){_0xce7fx22= _0xc776[74]}else {if(_0xce7fxd=== _0xc776[25]){_0xce7fx22= _0xc776[75]}};break;default:_0xce7fx22= _0xc776[75];console[_0xc776[15]](_0xc776[55],_0xce7fxc)}};return _0xce7fx22}function getEndUserNamePropertyFromChannel(_0xce7fxc,_0xce7fxd){var _0xce7fx22=_0xc776[52];if(_0xce7fxc){switch(_0xce7fxc){case _0xc776[54]:if(_0xce7fxd=== _0xc776[73]){_0xce7fx22= _0xc776[76]}else {if(_0xce7fxd=== _0xc776[25]){_0xce7fx22= _0xc776[77]}};break;default:_0xce7fx22= _0xc776[77];console[_0xc776[15]](_0xc776[55],_0xce7fxc)}};return _0xce7fx22}function handleEndUser(_0xce7fx10,_0xce7fxc,_0xce7fx25,_0xce7fxd){return function(_0xce7fxe){if(_0xce7fxe[_0xc776[61]][_0xc776[60]]> 0&& _0xce7fxe[_0xc776[62]]> 0){console[_0xc776[11]](_0xc776[78],getValueFromPropertyName(_0xce7fx25,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd)));_0xce7fx10[_0xc776[79]]= _0xce7fxe[_0xc776[61]][0];return _0xce7fx10[_0xc776[79]]};return}}function endUserCreation(_0xce7fx10,_0xce7fxc,_0xce7fx25,_0xce7fxd){return function(_0xce7fxe){if(_0xce7fxe){return};console[_0xc776[11]](_0xc776[80],getValueFromPropertyName(_0xce7fx25,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd)));console[_0xc776[11]](getJsonForEndUserCreation(_0xce7fxc,_0xce7fx25,_0xce7fxd));return rp({uri:_0xce7fx10[_0xc776[20]]+ _0xc776[81],method:_0xc776[82],body:{user:getJsonForEndUserCreation(_0xce7fxc,_0xce7fx25,_0xce7fxd)},headers:_0xce7fx10[_0xc776[21]],json:true})}}function getJsonForEndUserCreation(_0xce7fxc,_0xce7fxe,_0xce7fxd){var _0xce7fx33={role:_0xc776[83]};switch(_0xce7fxc){case _0xc776[54]:if(_0xce7fxd=== _0xc776[25]){if(isValidName(_0xce7fxe[_0xc776[77]])){_0xce7fx33[_0xc776[26]]= getValueFromPropertyName(_0xce7fxe,getEndUserNamePropertyFromChannel(_0xce7fxc,_0xce7fxd))}else {_0xce7fx33[_0xc776[26]]= util[_0xc776[51]](_0xc776[84],getValueFromPropertyName(_0xce7fxe,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd)))}}else {if(_0xce7fxd=== _0xc776[73]){if(isValidName(_0xce7fxe[_0xc776[76]])){_0xce7fx33[_0xc776[26]]= getValueFromPropertyName(_0xce7fxe,getEndUserNamePropertyFromChannel(_0xce7fxc,_0xce7fxd))}else {_0xce7fx33[_0xc776[26]]= util[_0xc776[51]](_0xc776[84],getValueFromPropertyName(_0xce7fxe,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd)))}}};_0xce7fx33[_0xc776[72]]= getValueFromPropertyName(_0xce7fxe,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd));break;default:console[_0xc776[15]](_0xc776[55],_0xce7fxc)};return _0xce7fx33}function isValidName(_0xce7fx35){return _0xce7fx35&& _0xce7fx35!== _0xc776[85]}function handleEndUserCreation(_0xce7fx10,_0xce7fxc,_0xce7fx25,_0xce7fxd){return function(_0xce7fxe){if(!_0xce7fxe){return};if(_0xce7fxe[_0xc776[68]]){console[_0xc776[11]](_0xc776[86],getValueFromPropertyName(_0xce7fx25,getEndUserSearchPropertyFromChannel(_0xce7fxc,_0xce7fxd)));_0xce7fx10[_0xc776[79]]= _0xce7fxe[_0xc776[68]]};return}}function ticketCreation(_0xce7fx10,_0xce7fx25,_0xce7fxf){return function(){var _0xce7fx38={requester_id:_0xce7fx10[_0xc776[64]][_0xc776[33]],submitter_id:_0xce7fx10[_0xc776[79]][_0xc776[33]],assignee_id:_0xce7fx10[_0xc776[79]][_0xc776[33]],tags:createTagsFromConfiguration(_0xce7fx10),subject:createSubjectFromConfiguration(_0xce7fx10,_0xce7fx25,_0xce7fxf),description:createDescriptionFromConfiguration(_0xce7fx10,_0xce7fx25,_0xce7fxf),custom_fields:createCustomFieldsFromConfiguration(_0xce7fx10,_0xce7fx25,_0xce7fxf)};var _0xce7fx39=createFieldsFromConfiguration(_0xce7fx10);if(_0xce7fx39[_0xc776[60]]> 0){_[_0xc776[88]](_0xce7fx39,function(_0xce7fx3a){_0xce7fx38[_0xce7fx3a[_0xc776[33]]]= _0xce7fx3a[_0xc776[87]]})};console[_0xc776[11]](_0xc776[89],_0xce7fx38);return rp({uri:_0xce7fx10[_0xc776[20]]+ _0xc776[90],method:_0xc776[82],body:{ticket:_0xce7fx38},headers:_0xce7fx10[_0xc776[21]],json:true})}}function createTagsFromConfiguration(_0xce7fx10){var _0xce7fx3c=[];if(_0xce7fx10[_0xc776[19]][_0xc776[91]][_0xc776[60]]> 0){_0xce7fx3c= _[_0xc776[92]](_0xce7fx10[_0xc776[19]].Tags,_0xc776[26])};return _0xce7fx3c}function createSubjectFromConfiguration(_0xce7fx10,_0xce7fx25,_0xce7fxf){var _0xce7fx3e=_0xc776[52];var _0xce7fx3f=[];if(_0xce7fx10[_0xc776[19]][_0xc776[93]][_0xc776[60]]> 0){var _0xce7fx40=_[_0xc776[94]](_0xce7fx10[_0xc776[19]].Subject,[_0xc776[33]]);_[_0xc776[88]](_0xce7fx40,function(_0xce7fx41){if(_0xce7fx41[_0xc776[95]]=== _0xc776[96]){_0xce7fx3f[_0xc776[98]](_0xce7fx41[_0xc776[97]])}else {if(_0xce7fx41[_0xc776[95]]=== _0xc776[99]&& _0xce7fx41[_0xc776[100]]){var _0xce7fx42=getValueFromPropertyName(_0xce7fx25,_0xce7fx41[_0xc776[100]],_0xce7fx10);if(_0xce7fx42){_0xce7fx3f[_0xc776[98]](_0xce7fx42.toString())}}else {if(_0xce7fx41[_0xc776[95]]=== _0xc776[101]){var _0xce7fx43=_[_0xc776[18]](_0xce7fxf,{"\x6E\x61\x6D\x65":_0xce7fx41[_0xc776[102]][_0xc776[26]]});if(_0xce7fx43){_0xce7fx3f[_0xc776[98]](_0xce7fx43[_0xc776[87]].toString())}}}}});_0xce7fx3e= _0xce7fx3f[_0xc776[104]](_0xc776[103])};return _0xce7fx3e}function createDescriptionFromConfiguration(_0xce7fx10,_0xce7fx25,_0xce7fxf){var _0xce7fx45=_0xc776[52];var _0xce7fx3f=[];if(_0xce7fx10[_0xc776[19]][_0xc776[105]][_0xc776[60]]> 0){var _0xce7fx46=_[_0xc776[94]](_0xce7fx10[_0xc776[19]].Description,[_0xc776[33]]);_[_0xc776[88]](_0xce7fx46,function(_0xce7fx41){if(_0xce7fx41[_0xc776[95]]=== _0xc776[96]){_0xce7fx3f[_0xc776[98]](_0xce7fx41[_0xc776[97]])}else {if(_0xce7fx41[_0xc776[95]]=== _0xc776[106]){if(_0xce7fx41[_0xc776[107]]=== _0xc776[96]){_0xce7fx3f[_0xc776[98]](util[_0xc776[51]](_0xc776[108],_0xce7fx41[_0xc776[109]],_0xce7fx41[_0xc776[110]]))}else {if(_0xce7fx41[_0xc776[107]]=== _0xc776[99]&& _0xce7fx41[_0xc776[100]]){var _0xce7fx42=getValueFromPropertyName(_0xce7fx25,_0xce7fx41[_0xc776[100]],_0xce7fx10);if(_0xce7fx42){_0xce7fx3f[_0xc776[98]](util[_0xc776[51]](_0xc776[108],_0xce7fx41[_0xc776[109]],_0xce7fx42.toString()))}}else {if(_0xce7fx41[_0xc776[107]]=== _0xc776[101]){var _0xce7fx43=_[_0xc776[18]](_0xce7fxf,{"\x6E\x61\x6D\x65":_0xce7fx41[_0xc776[102]][_0xc776[26]]});if(_0xce7fx43){_0xce7fx3f[_0xc776[98]](util[_0xc776[51]](_0xc776[108],_0xce7fx41[_0xc776[109]],_0xce7fx43[_0xc776[87]].toString()))}}}}}}});_0xce7fx45= _0xce7fx3f[_0xc776[104]](_0xc776[111])};return _0xce7fx45}function createCustomFieldsFromConfiguration(_0xce7fx10,_0xce7fx25,_0xce7fxf){var _0xce7fx48=[];var _0xce7fx49=[];if(_0xce7fx10[_0xc776[19]][_0xc776[112]][_0xc776[60]]> 0){_0xce7fx48= _[_0xc776[113]](_0xce7fx10[_0xc776[19]].Field,{"\x63\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64":true});_[_0xc776[88]](_0xce7fx48,function(_0xce7fx3a){if(_0xce7fx3a[_0xc776[95]]=== _0xc776[96]){_0xce7fx49[_0xc776[98]]({id:_0xce7fx3a[_0xc776[114]],value:_0xce7fx3a[_0xc776[97]]})}else {if(_0xce7fx3a[_0xc776[95]]=== _0xc776[99]){var _0xce7fx42=getValueFromPropertyName(_0xce7fx25,_0xce7fx3a[_0xc776[100]],_0xce7fx10);if(_0xce7fx42){_0xce7fx49[_0xc776[98]]({id:_0xce7fx3a[_0xc776[114]],value:_0xce7fx42.toString()})}}else {if(_0xce7fx3a[_0xc776[95]]=== _0xc776[101]){var _0xce7fx43=_[_0xc776[18]](_0xce7fxf,{"\x6E\x61\x6D\x65":_0xce7fx3a[_0xc776[102]][_0xc776[26]]});if(_0xce7fx43){_0xce7fx49[_0xc776[98]]({id:_0xce7fx3a[_0xc776[114]],value:_0xce7fx43[_0xc776[87]].toString()})}}}}})};return _0xce7fx49}function createFieldsFromConfiguration(_0xce7fx10){var _0xce7fx39=[];var _0xce7fx49=[];if(_0xce7fx10[_0xc776[19]][_0xc776[112]][_0xc776[60]]> 0){_0xce7fx39= _[_0xc776[113]](_0xce7fx10[_0xc776[19]].Field,{"\x63\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64":false});_[_0xc776[88]](_0xce7fx39,function(_0xce7fx3a){if(_0xce7fx3a[_0xc776[95]]=== _0xc776[96]){_0xce7fx49[_0xc776[98]]({id:_0xce7fx3a[_0xc776[115]],value:_0xce7fx3a[_0xc776[97]]})}})};return _0xce7fx49}function handleTicketDisplay(_0xce7fx10){return function(_0xce7fxe){if(_0xce7fxe[_0xc776[116]]){console[_0xc776[11]](_0xc776[117]);_0xce7fx10[_0xc776[116]]= _0xce7fxe[_0xc776[116]];var _0xce7fx4c=util[_0xc776[51]](_0xc776[118],_0xce7fx10[_0xc776[64]][_0xc776[33]],_0xce7fx10[_0xc776[116]][_0xc776[33]]);return rp({uri:_0xce7fx10[_0xc776[20]]+ _0xce7fx4c,method:_0xc776[82],headers:_0xce7fx10[_0xc776[21]],json:true})};return}}function handleReportIntegration(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxa){return function(){delete _0xce7fxe[_0xc776[33]];_0xce7fxe[_0xc776[119]]= _0xc776[120];_0xce7fxe[_0xc776[121]]= _0xce7fxc;_0xce7fxe[_0xc776[122]]= _0xc776[123];_0xce7fxe[_0xc776[124]]= _0xce7fx10[_0xc776[116]][_0xc776[33]];_0xce7fxe[_0xc776[125]]= _0xce7fx10[_0xc776[116]][_0xc776[125]];_0xce7fxe[_0xc776[126]]= _0xce7fxa;return ReportIntegration[_0xc776[127]](_0xce7fxe)}}function handleEnd(_0xce7fx10,_0xce7fxe,_0xce7fxc){return function(){console[_0xc776[11]](util[_0xc776[51]](_0xc776[128],_0xce7fx10[_0xc776[116]][_0xc776[33]],_0xce7fx10[_0xc776[64]][_0xc776[33]]));_0xce7fx10= undefined;return}}function handleError(_0xce7fx10,_0xce7fxc,_0xce7fxe,_0xce7fxa){return function(_0xce7fx50){console[_0xc776[15]](_0xc776[129]);console[_0xc776[15]](_0xc776[130],_0xce7fx50[_0xc776[131]]);console[_0xc776[15]](_0xc776[132],_0xce7fx50[_0xc776[133]]);_0xce7fx10= undefined;delete _0xce7fxe[_0xc776[33]];_0xce7fxe[_0xc776[119]]= _0xc776[120];_0xce7fxe[_0xc776[121]]= _0xce7fxc;_0xce7fxe[_0xc776[122]]= _0xc776[134];_0xce7fxe[_0xc776[126]]= _0xce7fxa;ReportIntegration[_0xc776[127]](_0xce7fxe)[_0xc776[17]](function(){return})[_0xc776[16]](function(_0xce7fx50){console[_0xc776[15]](_0xc776[135]);return})}}function stripTrailingSlash(_0xce7fx52){if(_0xce7fx52[_0xc776[136]](-1) === _0xc776[137]){return _0xce7fx52[_0xc776[136]](0,_0xce7fx52[_0xc776[60]]- 1)};return _0xce7fx52}module[_0xc776[138]]= Zendesk