206a2a93b7f1add14e8ba80e235091b4ab1b2b8c
[motion.git] / server / config / integrations / zendesk.js
1 var _0x1055=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x75\x72\x6C","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x5A\x65\x6E\x64\x65\x73\x6B\x43\x6F\x6E\x66\x69\x67\x75\x72\x61\x74\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\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","\x55\x73\x65\x72","\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","\x69\x6E\x66\x6F","\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","\x72\x65\x6D\x6F\x74\x65\x55\x72\x69","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x61\x67\x65\x6E\x74\x4E\x61\x6D\x65","\x71\x75\x65\x75\x65","\x6E\x61\x6D\x65","\x6D\x6F\x6E\x69\x74\x6F\x72\x5F\x66\x6F\x72\x6D\x61\x74","\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","\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\x3F\x74\x79\x70\x65\x3D\x75\x6E\x69\x71\x75\x65\x69\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","\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","\x64\x65\x62\x75\x67","\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","\x6B\x65\x79","\x25\x73\x3A\x20\x25\x73","\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","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x54\x61\x62","\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","\x70\x61\x72\x73\x65","\x70\x61\x74\x68","\x73\x65\x61\x72\x63\x68","\x68\x72\x65\x66","\x71\x75\x65\x72\x79","\x70\x61\x74\x68\x6E\x61\x6D\x65","\x74\x61\x62\x55\x72\x6C","\x25\x73\x2F\x61\x67\x65\x6E\x74\x2F\x74\x69\x63\x6B\x65\x74\x73\x2F\x25\x73","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x75\x70\x64\x61\x74\x65\x64\x41\x74","\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","\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x49\x64","\x73\x75\x62\x74\x79\x70\x65\x43\x68\x61\x6E\x6E\x65\x6C","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x72\x65\x70\x6F\x72\x74\x5F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x3A\x7A\x65\x6E\x64\x65\x73\x6B","\x65\x6D\x69\x74","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x74\x6F","\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\x25\x73\x20\x74\x6F\x20\x61\x67\x65\x6E\x74\x20\x25\x64","\x6F\x70\x65\x6E\x65\x64","\x64\x69\x73\x70\x6C\x61\x79\x65\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"];_0x1055[0];var _=require(_0x1055[1]);var util=require(_0x1055[2]);var url=require(_0x1055[3]);var rp=require(_0x1055[4]);var logger=require(_0x1055[6])(_0x1055[5]);var ZendeskConfiguration=require(_0x1055[8])[_0x1055[7]];var ReportIntegration=require(_0x1055[8])[_0x1055[9]];var VoiceQueue=require(_0x1055[8])[_0x1055[10]];var VoiceExtension=require(_0x1055[8])[_0x1055[11]];var Agent=require(_0x1055[8])[_0x1055[12]];function Zendesk(){logger[_0x1055[14]](_0x1055[13])}Zendesk[_0x1055[16]][_0x1055[15]]= function(_0x3a7dxc,_0x3a7dxd,_0x3a7dxe,_0x3a7dxf,_0x3a7dx10,_0x3a7dx11,_0x3a7dx12){var _0x3a7dx13={uri:undefined,headers:undefined,agent:undefined,enduser:undefined,ticket:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,tabUrl:undefined};if(!_0x3a7dxc||  !_0x3a7dxd){logger[_0x1055[18]](_0x1055[17]);return};ZendeskConfiguration[_0x1055[21]]({where:{id:_0x3a7dxd,AccountId:_0x3a7dxc},include:[{all:true,include:[{all:true}]}]})[_0x1055[20]](handleEntityNotFound())[_0x1055[20]](handleConnection(_0x3a7dx13))[_0x1055[20]](searchMotionAgent(_0x3a7dxe,_0x3a7dx10))[_0x1055[20]](handleMotionAgent(_0x3a7dx13))[_0x1055[20]](searchQueue(_0x3a7dx10))[_0x1055[20]](handleQueueRecordings(_0x3a7dx13,_0x3a7dx10))[_0x1055[20]](searchRoute(_0x3a7dx10))[_0x1055[20]](handleOutboundRecordings(_0x3a7dx13,_0x3a7dx10))[_0x1055[20]](searchAgent(_0x3a7dx13))[_0x1055[20]](handleAgent(_0x3a7dx13))[_0x1055[20]](searchAdmin(_0x3a7dx13))[_0x1055[20]](handleAdmin(_0x3a7dx13))[_0x1055[20]](searchEndUser(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxf))[_0x1055[20]](handleEndUser(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxf))[_0x1055[20]](endUserCreation(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxf))[_0x1055[20]](handleEndUserCreation(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxf))[_0x1055[20]](ticketCreation(_0x3a7dx13,_0x3a7dx10,_0x3a7dx11))[_0x1055[20]](handleTicketDisplay(_0x3a7dx13))[_0x1055[20]](handleReportIntegration(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxc,_0x3a7dxf,_0x3a7dx12))[_0x1055[20]](handleEnd(_0x3a7dx13))[_0x1055[19]](handleError(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxc))};function handleEntityNotFound(){return function(_0x3a7dx15){if(!_0x3a7dx15){return null};return _0x3a7dx15}}function handleConnection(_0x3a7dx13){return function(_0x3a7dx17){var _0x3a7dx18=getAccountConfiguration(_0x3a7dx17.ZendeskAccount);_0x3a7dx13[_0x1055[22]]= _0x3a7dx17;_0x3a7dx13[_0x1055[23]]= _0x3a7dx18[_0x1055[23]];_0x3a7dx13[_0x1055[24]]= _0x3a7dx18[_0x1055[24]];_0x3a7dx13[_0x1055[25]]= _0x3a7dx17[_0x1055[27]][_0x1055[26]];_0x3a7dx13[_0x1055[28]]= _0x3a7dx17[_0x1055[27]][_0x1055[28]]}}function searchMotionAgent(_0x3a7dxe,_0x3a7dx10){return function(){var _0x3a7dx1a=getAgentSearchPropertyFromChannel(_0x3a7dxe);if(_0x3a7dx10[_0x1055[29]](_0x3a7dx1a)){return Agent[_0x1055[33]](_0x1055[32])[_0x1055[31]]({where:{name:getValueFromPropertyName(_0x3a7dx10,_0x3a7dx1a)},attributes:[_0x1055[30]]})};return}}function handleMotionAgent(_0x3a7dx13){return function(_0x3a7dx1c){if(_0x3a7dx1c&& _0x3a7dx1c[_0x1055[30]]){_0x3a7dx13[_0x1055[34]]= _0x3a7dx1c[_0x1055[30]]};return}}function searchQueue(_0x3a7dx10){return function(){if(_0x3a7dx10[_0x1055[35]]){return VoiceQueue[_0x1055[31]]({where:{name:_0x3a7dx10[_0x1055[35]]},attributes:[_0x1055[36],_0x1055[37]]})}else {return}}}function handleQueueRecordings(_0x3a7dx13,_0x3a7dx10){return function(_0x3a7dx1f){if(_0x3a7dx10[_0x1055[35]]){if(_0x3a7dx1f&& _0x3a7dx1f[_0x1055[37]]){logger[_0x1055[14]](_0x1055[38],_0x3a7dx1f[_0x1055[36]]);_0x3a7dx13[_0x1055[39]]= true}else {_0x3a7dx13[_0x1055[39]]= false;logger[_0x1055[14]](_0x1055[40])}};return}}function searchRoute(_0x3a7dx10){return function(){if(_0x3a7dx10[_0x1055[41]]){return VoiceExtension[_0x1055[31]]({where:{id:_0x3a7dx10[_0x1055[41]]},attributes:[_0x1055[42],_0x1055[43]]})}else {return}}}function handleOutboundRecordings(_0x3a7dx13,_0x3a7dx10){return function(_0x3a7dx22){if(_0x3a7dx10[_0x1055[41]]){if(_0x3a7dx22&& _0x3a7dx22[_0x1055[43]]){logger[_0x1055[14]](_0x1055[44],_0x3a7dx22[_0x1055[42]]);_0x3a7dx13[_0x1055[39]]= true}else {_0x3a7dx13[_0x1055[39]]= false;logger[_0x1055[14]](_0x1055[45])}};return}}function getAccountConfiguration(_0x3a7dx24){var _0x3a7dx25={uri:stripTrailingSlash(_0x3a7dx24[_0x1055[28]]),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":_0x1055[46],"\x41\x63\x63\x65\x70\x74":_0x1055[46]}};var _0x3a7dx26=_0x3a7dx24[_0x1055[47]];if(_0x3a7dx24[_0x1055[48]]=== _0x1055[49]){_0x3a7dx26= _0x3a7dx26+ _0x1055[50]+ _0x3a7dx24[_0x1055[49]]}else {if(_0x3a7dx24[_0x1055[48]]=== _0x1055[51]){_0x3a7dx26= _0x3a7dx26+ _0x1055[52]+ _0x3a7dx24[_0x1055[51]]}};_0x3a7dx25[_0x1055[24]][_0x1055[53]]= _0x1055[54]+  new Buffer(_0x3a7dx26).toString(_0x1055[55]);return _0x3a7dx25}function searchAgent(_0x3a7dx13){return function(){if(_0x3a7dx13[_0x1055[34]]){logger[_0x1055[14]](_0x1055[56],_0x3a7dx13[_0x1055[34]]);return rp({uri:_0x3a7dx13[_0x1055[23]]+ _0x1055[57],qs:{"\x71\x75\x65\x72\x79":util[_0x1055[59]](_0x1055[58],_0x3a7dx13[_0x1055[34]])},headers:_0x3a7dx13[_0x1055[24]],json:true})};return}}function getAgentSearchPropertyFromChannel(_0x3a7dxe){var _0x3a7dx29=_0x1055[60];if(_0x3a7dxe){switch(_0x3a7dxe){case _0x1055[62]:_0x3a7dx29= _0x1055[61];break;default:_0x3a7dx29= _0x1055[61];logger[_0x1055[18]](_0x1055[63],_0x3a7dxe)}};return _0x3a7dx29}function getValueFromPropertyName(_0x3a7dx10,_0x3a7dx29,_0x3a7dx13){if(_0x3a7dx29=== _0x1055[64]){if(_0x3a7dx13&& _0x3a7dx13[_0x1055[39]]&& _0x3a7dx13[_0x1055[25]]){return util[_0x1055[59]](_0x1055[65],stripTrailingSlash(_0x3a7dx13[_0x1055[25]]),_0x3a7dx10[_0x1055[66]])}else {return null}}else {return _[_0x1055[67]](_0x3a7dx10,_0x3a7dx29)}}function handleAgent(_0x3a7dx13){return function(_0x3a7dx10){if(_0x3a7dx10&& _0x3a7dx10[_0x1055[69]][_0x1055[68]]> 0&& _0x3a7dx10[_0x1055[70]]> 0){logger[_0x1055[14]](_0x1055[71],_0x3a7dx13[_0x1055[34]]);_0x3a7dx13[_0x1055[32]]= getMatchObject(_0x3a7dx10[_0x1055[69]],_0x1055[36],_0x3a7dx13[_0x1055[34]]);return _0x3a7dx13[_0x1055[32]]};return}}function getMatchObject(_0x3a7dx2d,_0x3a7dx29,_0x3a7dx2e){var _0x3a7dx2f=_[_0x1055[21]](_0x3a7dx2d,{property:_0x3a7dx2e});if(_0x3a7dx2f){return _0x3a7dx2f};return _[_0x1055[72]](_0x3a7dx2d)}function searchAdmin(_0x3a7dx13){return function(_0x3a7dx10){if(_0x3a7dx10){return};logger[_0x1055[14]](_0x1055[73]);return rp({uri:_0x3a7dx13[_0x1055[23]]+ _0x1055[74],headers:_0x3a7dx13[_0x1055[24]],json:true})}}function handleAdmin(_0x3a7dx13){return function(_0x3a7dx10){if(!_0x3a7dx10){return};if(_0x3a7dx10[_0x1055[75]]){logger[_0x1055[14]](_0x1055[76]);_0x3a7dx13[_0x1055[32]]= _0x3a7dx10[_0x1055[75]]};return}}function searchEndUser(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxf){return function(){logger[_0x1055[14]](_0x1055[77],getValueFromPropertyName(_0x3a7dx10,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf)));return rp({uri:_0x3a7dx13[_0x1055[23]]+ _0x1055[57],qs:{"\x71\x75\x65\x72\x79":util[_0x1055[59]](_0x1055[78],getEndUserSearchQueryFromChannel(_0x3a7dxe),getValueFromPropertyName(_0x3a7dx10,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf)))},headers:_0x3a7dx13[_0x1055[24]],json:true})}}function getEndUserSearchQueryFromChannel(_0x3a7dxe){var _0x3a7dx29=_0x1055[60];if(_0x3a7dxe){switch(_0x3a7dxe){case _0x1055[62]:_0x3a7dx29= _0x1055[79];break;default:_0x3a7dx29= _0x1055[79];logger[_0x1055[18]](_0x1055[63],_0x3a7dxe)}};return _0x3a7dx29}function getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf){var _0x3a7dx29=_0x1055[60];if(_0x3a7dxe){switch(_0x3a7dxe){case _0x1055[62]:if(_0x3a7dxf=== _0x1055[80]){_0x3a7dx29= _0x1055[81]}else {if(_0x3a7dxf=== _0x1055[35]){_0x3a7dx29= _0x1055[82]}};break;default:_0x3a7dx29= _0x1055[82];logger[_0x1055[18]](_0x1055[63],_0x3a7dxe)}};return _0x3a7dx29}function getEndUserNamePropertyFromChannel(_0x3a7dxe,_0x3a7dxf){var _0x3a7dx29=_0x1055[60];if(_0x3a7dxe){switch(_0x3a7dxe){case _0x1055[62]:if(_0x3a7dxf=== _0x1055[80]){_0x3a7dx29= _0x1055[83]}else {if(_0x3a7dxf=== _0x1055[35]){_0x3a7dx29= _0x1055[84]}};break;default:_0x3a7dx29= _0x1055[84];logger[_0x1055[18]](_0x1055[63],_0x3a7dxe)}};return _0x3a7dx29}function handleEndUser(_0x3a7dx13,_0x3a7dxe,_0x3a7dx37,_0x3a7dxf){return function(_0x3a7dx10){if(_0x3a7dx10[_0x1055[69]][_0x1055[68]]> 0&& _0x3a7dx10[_0x1055[70]]> 0){logger[_0x1055[14]](_0x1055[85],getValueFromPropertyName(_0x3a7dx37,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf)));_0x3a7dx13[_0x1055[86]]= _0x3a7dx10[_0x1055[69]][0];return _0x3a7dx13[_0x1055[86]]};return}}function endUserCreation(_0x3a7dx13,_0x3a7dxe,_0x3a7dx37,_0x3a7dxf){return function(_0x3a7dx10){if(_0x3a7dx10){return};logger[_0x1055[14]](_0x1055[87],getValueFromPropertyName(_0x3a7dx37,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf)));logger[_0x1055[88]](getJsonForEndUserCreation(_0x3a7dxe,_0x3a7dx37,_0x3a7dxf));return rp({uri:_0x3a7dx13[_0x1055[23]]+ _0x1055[89],method:_0x1055[90],body:{user:getJsonForEndUserCreation(_0x3a7dxe,_0x3a7dx37,_0x3a7dxf)},headers:_0x3a7dx13[_0x1055[24]],json:true})}}function getJsonForEndUserCreation(_0x3a7dxe,_0x3a7dx10,_0x3a7dxf){var _0x3a7dx3a={role:_0x1055[91]};switch(_0x3a7dxe){case _0x1055[62]:if(_0x3a7dxf=== _0x1055[35]){if(isValidName(_0x3a7dx10[_0x1055[84]])){_0x3a7dx3a[_0x1055[36]]= getValueFromPropertyName(_0x3a7dx10,getEndUserNamePropertyFromChannel(_0x3a7dxe,_0x3a7dxf))}else {_0x3a7dx3a[_0x1055[36]]= util[_0x1055[59]](_0x1055[92],getValueFromPropertyName(_0x3a7dx10,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf)))}}else {if(_0x3a7dxf=== _0x1055[80]){if(isValidName(_0x3a7dx10[_0x1055[83]])){_0x3a7dx3a[_0x1055[36]]= getValueFromPropertyName(_0x3a7dx10,getEndUserNamePropertyFromChannel(_0x3a7dxe,_0x3a7dxf))}else {_0x3a7dx3a[_0x1055[36]]= util[_0x1055[59]](_0x1055[92],getValueFromPropertyName(_0x3a7dx10,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf)))}}};_0x3a7dx3a[_0x1055[79]]= getValueFromPropertyName(_0x3a7dx10,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf));break;default:logger[_0x1055[18]](_0x1055[63],_0x3a7dxe)};return _0x3a7dx3a}function isValidName(_0x3a7dx3c){return _0x3a7dx3c&& _0x3a7dx3c!== _0x1055[93]}function handleEndUserCreation(_0x3a7dx13,_0x3a7dxe,_0x3a7dx37,_0x3a7dxf){return function(_0x3a7dx10){if(!_0x3a7dx10){return};if(_0x3a7dx10[_0x1055[75]]){logger[_0x1055[14]](_0x1055[94],getValueFromPropertyName(_0x3a7dx37,getEndUserSearchPropertyFromChannel(_0x3a7dxe,_0x3a7dxf)));_0x3a7dx13[_0x1055[86]]= _0x3a7dx10[_0x1055[75]]};return}}function ticketCreation(_0x3a7dx13,_0x3a7dx37,_0x3a7dx11){return function(){var _0x3a7dx3f={requester_id:_0x3a7dx13[_0x1055[86]][_0x1055[42]],submitter_id:_0x3a7dx13[_0x1055[32]][_0x1055[42]],assignee_id:_0x3a7dx13[_0x1055[32]][_0x1055[42]],tags:createTagsFromConfiguration(_0x3a7dx13),subject:createSubjectFromConfiguration(_0x3a7dx13,_0x3a7dx37,_0x3a7dx11),comment:{public:false,body:createDescriptionFromConfiguration(_0x3a7dx13,_0x3a7dx37,_0x3a7dx11)},custom_fields:createCustomFieldsFromConfiguration(_0x3a7dx13,_0x3a7dx37,_0x3a7dx11)};var _0x3a7dx40=createFieldsFromConfiguration(_0x3a7dx13);if(_0x3a7dx40[_0x1055[68]]> 0){_[_0x1055[96]](_0x3a7dx40,function(_0x3a7dx41){_0x3a7dx3f[_0x3a7dx41[_0x1055[42]]]= _0x3a7dx41[_0x1055[95]]})};logger[_0x1055[88]](_0x1055[97],_0x3a7dx3f);return rp({uri:_0x3a7dx13[_0x1055[23]]+ _0x1055[98],method:_0x1055[90],body:{ticket:_0x3a7dx3f},headers:_0x3a7dx13[_0x1055[24]],json:true})}}function createTagsFromConfiguration(_0x3a7dx13){var _0x3a7dx43=[];if(_0x3a7dx13[_0x1055[22]][_0x1055[99]][_0x1055[68]]> 0){_0x3a7dx43= _[_0x1055[100]](_0x3a7dx13[_0x1055[22]].Tags,_0x1055[36])};return _0x3a7dx43}function createSubjectFromConfiguration(_0x3a7dx13,_0x3a7dx37,_0x3a7dx11){var _0x3a7dx45=_0x1055[60];var _0x3a7dx46=[];if(_0x3a7dx13[_0x1055[22]][_0x1055[101]][_0x1055[68]]> 0){var _0x3a7dx47=_[_0x1055[102]](_0x3a7dx13[_0x1055[22]].Subject,[_0x1055[42]]);_[_0x1055[96]](_0x3a7dx47,function(_0x3a7dx48){if(_0x3a7dx48[_0x1055[103]]=== _0x1055[104]){_0x3a7dx46[_0x1055[106]](_0x3a7dx48[_0x1055[105]])}else {if(_0x3a7dx48[_0x1055[103]]=== _0x1055[107]&& _0x3a7dx48[_0x1055[108]]){var _0x3a7dx49=getValueFromPropertyName(_0x3a7dx37,_0x3a7dx48[_0x1055[108]],_0x3a7dx13);if(_0x3a7dx49){_0x3a7dx46[_0x1055[106]](_0x3a7dx49.toString())}}else {if(_0x3a7dx48[_0x1055[103]]=== _0x1055[109]&& _0x3a7dx48[_0x1055[110]]&& _0x3a7dx48[_0x1055[110]][_0x1055[36]]){_0x3a7dx11[_0x3a7dx48[_0x1055[110]][_0x1055[36]]]&& _0x3a7dx46[_0x1055[106]](_0x3a7dx11[_0x3a7dx48[_0x1055[110]][_0x1055[36]]].toString())}}}});_0x3a7dx45= _0x3a7dx46[_0x1055[112]](_0x1055[111])};return _0x3a7dx45}function createDescriptionFromConfiguration(_0x3a7dx13,_0x3a7dx37,_0x3a7dx11){var _0x3a7dx4b=_0x1055[60];var _0x3a7dx46=[];if(_0x3a7dx13[_0x1055[22]][_0x1055[113]][_0x1055[68]]> 0){var _0x3a7dx4c=_[_0x1055[102]](_0x3a7dx13[_0x1055[22]].Description,[_0x1055[42]]);_[_0x1055[96]](_0x3a7dx4c,function(_0x3a7dx48){if(_0x3a7dx48[_0x1055[103]]=== _0x1055[104]){_0x3a7dx46[_0x1055[106]](_0x3a7dx48[_0x1055[105]])}else {if(_0x3a7dx48[_0x1055[103]]=== _0x1055[114]){if(_0x3a7dx48[_0x1055[115]]=== _0x1055[104]&& _0x3a7dx48[_0x1055[116]]){_0x3a7dx46[_0x1055[106]](util[_0x1055[59]](_0x1055[117],_0x3a7dx48[_0x1055[116]],_0x3a7dx48[_0x1055[118]]))}else {if(_0x3a7dx48[_0x1055[115]]=== _0x1055[107]&& _0x3a7dx48[_0x1055[108]]&& _0x3a7dx48[_0x1055[116]]){var _0x3a7dx49=getValueFromPropertyName(_0x3a7dx37,_0x3a7dx48[_0x1055[108]],_0x3a7dx13);if(_0x3a7dx49){_0x3a7dx46[_0x1055[106]](util[_0x1055[59]](_0x1055[117],_0x3a7dx48[_0x1055[116]],_0x3a7dx49.toString()))}}else {if(_0x3a7dx48[_0x1055[115]]=== _0x1055[109]&& _0x3a7dx48[_0x1055[110]]&& _0x3a7dx48[_0x1055[110]][_0x1055[36]]&& _0x3a7dx48[_0x1055[116]]){_0x3a7dx11[_0x3a7dx48[_0x1055[110]][_0x1055[36]]]&& _0x3a7dx46[_0x1055[106]](util[_0x1055[59]](_0x1055[117],_0x3a7dx48[_0x1055[116]],_0x3a7dx11[_0x3a7dx48[_0x1055[110]][_0x1055[36]]]))}}}}}});_0x3a7dx4b= _0x3a7dx46[_0x1055[112]](_0x1055[119])};return _0x3a7dx4b}function createCustomFieldsFromConfiguration(_0x3a7dx13,_0x3a7dx37,_0x3a7dx11){var _0x3a7dx4e=[];var _0x3a7dx4f=[];if(_0x3a7dx13[_0x1055[22]][_0x1055[120]][_0x1055[68]]> 0){_0x3a7dx4e= _[_0x1055[121]](_0x3a7dx13[_0x1055[22]].Field,{"\x63\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64":true});_[_0x1055[96]](_0x3a7dx4e,function(_0x3a7dx41){if(_0x3a7dx41[_0x1055[103]]=== _0x1055[104]&& _0x3a7dx41[_0x1055[122]]){_0x3a7dx4f[_0x1055[106]]({id:_0x3a7dx41[_0x1055[122]],value:_0x3a7dx41[_0x1055[105]]})}else {if(_0x3a7dx41[_0x1055[103]]=== _0x1055[107]&& _0x3a7dx41[_0x1055[108]]&& _0x3a7dx41[_0x1055[122]]){var _0x3a7dx49=getValueFromPropertyName(_0x3a7dx37,_0x3a7dx41[_0x1055[108]],_0x3a7dx13);if(_0x3a7dx49){_0x3a7dx4f[_0x1055[106]]({id:_0x3a7dx41[_0x1055[122]],value:_0x3a7dx49.toString()})}}else {if(_0x3a7dx41[_0x1055[103]]=== _0x1055[109]&& _0x3a7dx41[_0x1055[110]]&& _0x3a7dx41[_0x1055[110]][_0x1055[36]]&& _0x3a7dx41[_0x1055[122]]){_0x3a7dx11[_0x3a7dx41[_0x1055[110]][_0x1055[36]]]&& _0x3a7dx4f[_0x1055[106]]({id:_0x3a7dx41[_0x1055[122]],value:_0x3a7dx11[_0x3a7dx41[_0x1055[110]][_0x1055[36]]].toString()})}}}})};return _0x3a7dx4f}function createFieldsFromConfiguration(_0x3a7dx13){var _0x3a7dx40=[];var _0x3a7dx4f=[];if(_0x3a7dx13[_0x1055[22]][_0x1055[120]][_0x1055[68]]> 0){_0x3a7dx40= _[_0x1055[121]](_0x3a7dx13[_0x1055[22]].Field,{"\x63\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64":false});_[_0x1055[96]](_0x3a7dx40,function(_0x3a7dx41){if(_0x3a7dx41[_0x1055[103]]=== _0x1055[104]&& _0x3a7dx41[_0x1055[123]]){_0x3a7dx4f[_0x1055[106]]({id:_0x3a7dx41[_0x1055[123]],value:_0x3a7dx41[_0x1055[105]]})}})};return _0x3a7dx4f}function handleTicketDisplay(_0x3a7dx13){return function(_0x3a7dx10){if(_0x3a7dx10[_0x1055[124]]){logger[_0x1055[14]](_0x1055[125]);_0x3a7dx13[_0x1055[124]]= _0x3a7dx10[_0x1055[124]];if(_0x3a7dx13[_0x1055[22]][_0x1055[27]][_0x1055[103]]=== _0x1055[126]){var _0x3a7dx52=util[_0x1055[59]](_0x1055[127],_0x3a7dx13[_0x1055[32]][_0x1055[42]],_0x3a7dx13[_0x1055[124]][_0x1055[42]]);return rp({uri:_0x3a7dx13[_0x1055[23]]+ _0x3a7dx52,method:_0x1055[90],headers:_0x3a7dx13[_0x1055[24]],json:true})}else {var _0x3a7dx53=url[_0x1055[128]](stripTrailingSlash(_0x3a7dx13[_0x1055[28]]));delete _0x3a7dx53[_0x1055[129]];delete _0x3a7dx53[_0x1055[130]];delete _0x3a7dx53[_0x1055[131]];delete _0x3a7dx53[_0x1055[132]];delete _0x3a7dx53[_0x1055[133]];if(_0x3a7dx53){_0x3a7dx13[_0x1055[134]]= util[_0x1055[59]](_0x1055[135],url[_0x1055[59]](_0x3a7dx53),_0x3a7dx10[_0x1055[124]][_0x1055[42]])}}};return}}function handleReportIntegration(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxc,_0x3a7dxf,_0x3a7dx12){return function(){delete _0x3a7dx10[_0x1055[42]];delete _0x3a7dx10[_0x1055[136]];delete _0x3a7dx10[_0x1055[137]];_0x3a7dx10[_0x1055[138]]= _0x1055[139];_0x3a7dx10[_0x1055[140]]= _0x3a7dxe;_0x3a7dx10[_0x1055[141]]= _0x1055[142];_0x3a7dx10[_0x1055[143]]= _0x3a7dx13[_0x1055[124]][_0x1055[42]];_0x3a7dx10[_0x1055[3]]= _0x3a7dx13[_0x1055[124]][_0x1055[3]];_0x3a7dx10[_0x1055[144]]= _0x3a7dxc;_0x3a7dx10[_0x1055[145]]= _0x3a7dxf;_0x3a7dx10[_0x1055[146]]= _0x3a7dx13[_0x1055[22]][_0x1055[27]][_0x1055[103]];if(_0x3a7dx13[_0x1055[134]]){_0x3a7dx10[_0x1055[3]]= _0x3a7dx13[_0x1055[134]];_0x3a7dx12[_0x1055[150]](util[_0x1055[59]](_0x1055[149],_0x3a7dx10[_0x1055[61]]))[_0x1055[148]](_0x1055[147],_0x3a7dx10)};return ReportIntegration[_0x1055[151]](_0x3a7dx10)}}function handleEnd(_0x3a7dx13,_0x3a7dx10,_0x3a7dxe){return function(){logger[_0x1055[14]](util[_0x1055[59]](_0x1055[152],_0x3a7dx13[_0x1055[124]][_0x1055[42]],_0x3a7dx13[_0x1055[134]]?_0x1055[153]:_0x1055[154],_0x3a7dx13[_0x1055[32]][_0x1055[42]]));_0x3a7dx13= undefined;return}}function handleError(_0x3a7dx13,_0x3a7dxe,_0x3a7dx10,_0x3a7dxc){return function(_0x3a7dx57){logger[_0x1055[18]](_0x1055[155]);logger[_0x1055[18]](_0x1055[156],_0x3a7dx57[_0x1055[157]]);logger[_0x1055[18]](_0x1055[158],_0x3a7dx57[_0x1055[159]]);_0x3a7dx13= undefined;delete _0x3a7dx10[_0x1055[42]];delete _0x3a7dx10[_0x1055[136]];delete _0x3a7dx10[_0x1055[137]];_0x3a7dx10[_0x1055[138]]= _0x1055[139];_0x3a7dx10[_0x1055[140]]= _0x3a7dxe;_0x3a7dx10[_0x1055[141]]= _0x1055[160];_0x3a7dx10[_0x1055[144]]= _0x3a7dxc;ReportIntegration[_0x1055[151]](_0x3a7dx10)[_0x1055[20]](function(){return})[_0x1055[19]](function(_0x3a7dx57){logger[_0x1055[18]](_0x1055[161]);return})}}function stripTrailingSlash(_0x3a7dx59){if(_0x3a7dx59[_0x1055[162]](-1) === _0x1055[163]){return _0x3a7dx59[_0x1055[162]](0,_0x3a7dx59[_0x1055[68]]- 1)};return _0x3a7dx59}module[_0x1055[164]]= Zendesk