Built motion from commit b621b9a.|1.0.14
[motion.git] / server / config / integrations / sugarcrm.js
1 var _0x4f22=["\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","\x72\x65\x71\x75\x65\x73\x74","\x53\x75\x67\x61\x72\x63\x72\x6D\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","\x53\x75\x67\x61\x72\x63\x72\x6D\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","\x73\x65\x72\x76\x65\x72\x55\x52\x4C","\x73\x65\x72\x76\x65\x72\x55\x72\x6C","\x53\x75\x67\x61\x72\x63\x72\x6D\x41\x63\x63\x6F\x75\x6E\x74","\x75\x72\x69","\x72\x65\x6D\x6F\x74\x65\x55\x72\x69","\x2F\x73\x65\x72\x76\x69\x63\x65\x2F\x76\x34\x5F\x31\x2F\x72\x65\x73\x74\x2E\x70\x68\x70","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x50\x4C\x41\x49\x4E","\x78\x43\x41\x4C\x4C\x59\x20\x4D\x6F\x74\x69\x6F\x6E\x20\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x6C\x6F\x67\x69\x6E","\x4A\x53\x4F\x4E","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x50\x4F\x53\x54","\x69\x64","\x73\x65\x73\x73\x69\x6F\x6E\x49\x44","\x61\x64\x6D\x69\x6E","\x76\x61\x6C\x75\x65","\x75\x73\x65\x72\x5F\x69\x64","\x6E\x61\x6D\x65\x5F\x76\x61\x6C\x75\x65\x5F\x6C\x69\x73\x74","\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65","\x41\x63\x63\x6F\x75\x6E\x74\x20\x25\x64\x20\x69\x73\x20\x6E\x6F\x74\x20\x76\x61\x6C\x69\x64","\x66\x6F\x72\x6D\x61\x74","\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","","\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","\x72\x65\x63\x6F\x72\x64\x45\x6E\x61\x62\x6C\x65","\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","\x71\x75\x65\x75\x65","\x6E\x61\x6D\x65","\x6D\x6F\x6E\x69\x74\x6F\x72\x5F\x66\x6F\x72\x6D\x61\x74","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\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","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\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","\x72\x65\x63\x6F\x72\x64","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\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\x53\x75\x67\x61\x72\x63\x72\x6D\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","\x67\x65\x74\x5F\x73\x65\x72\x76\x65\x72\x5F\x69\x6E\x66\x6F","\x63\x68\x61\x72\x41\x74","\x76\x65\x72\x73\x69\x6F\x6E","\x73\x65\x72\x76\x65\x72\x56\x65\x72\x73\x69\x6F\x6E","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x41\x67\x65\x6E\x74\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A","\x67\x65\x74\x5F\x65\x6E\x74\x72\x79\x5F\x6C\x69\x73\x74","\x45\x6D\x70\x6C\x6F\x79\x65\x65\x73","\x49\x4E\x53\x54\x52\x20\x28\x20\x43\x4F\x4E\x43\x41\x54\x28\x75\x73\x65\x72\x73\x2E\x66\x69\x72\x73\x74\x5F\x6E\x61\x6D\x65\x2C\x27\x20\x27\x2C\x20\x75\x73\x65\x72\x73\x2E\x6C\x61\x73\x74\x5F\x6E\x61\x6D\x65\x29\x2C\x20\x22\x25\x73\x22\x29\x20\x3E\x20\x30","\x30","\x6C\x65\x6E\x67\x74\x68","\x65\x6E\x74\x72\x79\x5F\x6C\x69\x73\x74","\x72\x65\x73\x75\x6C\x74\x5F\x63\x6F\x75\x6E\x74","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x41\x67\x65\x6E\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\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","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x41\x64\x6D\x69\x6E\x20\x73\x65\x6C\x65\x63\x74\x65\x64","\x64\x65\x66\x61\x75\x6C\x74\x4D\x61\x70\x70\x69\x6E\x67","\x43\x6F\x6E\x74\x61\x63\x74\x73","\x6D\x61\x70\x70\x69\x6E\x67\x4D\x6F\x64\x75\x6C\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x25\x73\x20\x74\x6F\x20\x73\x65\x61\x72\x63\x68\x3A\x20\x25\x73","\x63\x6F\x6E\x74\x61\x63\x74\x73\x2E\x25\x73\x20\x3D\x20\x22\x25\x73\x22","\x25\x73\x2E\x25\x73\x20\x3D\x20\x22\x25\x73\x22","\x74\x6F\x4C\x6F\x77\x65\x72","\x6D\x61\x70\x70\x69\x6E\x67\x46\x69\x65\x6C\x64\x73","\x68\x65\x61\x64","\x20\x4F\x52\x20\x25\x73\x2E\x25\x73\x20\x3D\x20\x22\x25\x73\x22","\x70\x68\x6F\x6E\x65\x5F\x68\x6F\x6D\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","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x25\x73\x20\x66\x6F\x75\x6E\x64\x3A\x20\x25\x73","\x65\x6E\x64\x75\x73\x65\x72","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x25\x73\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x3A\x20\x25\x73","\x73\x65\x74\x5F\x65\x6E\x74\x72\x79","\x66\x69\x72\x73\x74\x5F\x6E\x61\x6D\x65","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x43\x61\x6C\x6C\x65\x72\x20\x2D\x20\x25\x73","\x64\x65\x73\x74\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x70\x75\x73\x68","\x3C\x75\x6E\x6B\x6E\x6F\x77\x6E\x3E","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x25\x73\x20\x63\x72\x65\x61\x74\x65\x64\x3A\x20\x25\x73","\x61\x73\x73\x69\x67\x6E\x65\x64\x5F\x75\x73\x65\x72\x5F\x69\x64","\x63\x72\x65\x61\x74\x65\x64\x5F\x62\x79","\x64\x65\x73\x63\x72\x69\x70\x74\x69\x6F\x6E","\x64\x61\x74\x65\x5F\x73\x74\x61\x72\x74","\x54","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x73\x6C\x69\x63\x65","\x74\x6F\x49\x53\x4F\x53\x74\x72\x69\x6E\x67","\x64\x75\x72\x61\x74\x69\x6F\x6E\x5F\x68\x6F\x75\x72\x73","\x64\x75\x72\x61\x74\x69\x6F\x6E\x5F\x6D\x69\x6E\x75\x74\x65\x73","\x31\x35","\x66\x6F\x72\x45\x61\x63\x68","\x43\x61\x6C\x6C\x73","\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","\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","\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","\x69\x64\x46\x69\x65\x6C\x64","\x63\x61\x6C\x6C","\x75\x72\x6C","\x25\x73\x2F\x69\x6E\x64\x65\x78\x2E\x70\x68\x70\x3F\x61\x63\x74\x69\x6F\x6E\x3D\x61\x6A\x61\x78\x75\x69\x23\x61\x6A\x61\x78\x55\x49\x4C\x6F\x63\x3D\x69\x6E\x64\x65\x78\x2E\x70\x68\x70\x25\x33\x46\x6D\x6F\x64\x75\x6C\x65\x25\x33\x44\x43\x61\x6C\x6C\x73\x25\x32\x36\x61\x63\x74\x69\x6F\x6E\x25\x33\x44\x45\x64\x69\x74\x56\x69\x65\x77\x25\x32\x36\x72\x65\x63\x6F\x72\x64\x25\x33\x44\x25\x73","\x25\x73\x2F\x23\x62\x77\x63\x2F\x69\x6E\x64\x65\x78\x2E\x70\x68\x70\x3F\x6D\x6F\x64\x75\x6C\x65\x3D\x43\x61\x6C\x6C\x73\x26\x61\x63\x74\x69\x6F\x6E\x3D\x45\x64\x69\x74\x56\x69\x65\x77\x26\x72\x65\x63\x6F\x72\x64\x3D\x25\x73","\x73\x65\x74\x5F\x72\x65\x6C\x61\x74\x69\x6F\x6E\x73\x68\x69\x70","\x75\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65\x64","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x61\x6C\x6C\x20\x25\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x74\x6F\x20\x74\x68\x65\x20\x61\x67\x65\x6E\x74\x20\x25\x73","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x61\x6C\x6C\x20\x25\x73\x20\x61\x73\x73\x6F\x63\x69\x61\x74\x65\x64\x20\x74\x6F\x20\x74\x68\x65\x20\x63\x6F\x6E\x74\x61\x63\x74\x20\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","\x73\x75\x67\x61\x72\x63\x72\x6D","\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","\x72\x65\x70\x6F\x72\x74\x5F\x69\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E\x3A\x73\x75\x67\x61\x72\x63\x72\x6D","\x65\x6D\x69\x74","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x74\x6F","\x63\x72\x65\x61\x74\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x43\x61\x6C\x6C\x20\x25\x73\x20\x64\x69\x73\x70\x6C\x61\x79\x65\x64\x20\x74\x6F\x20\x61\x67\x65\x6E\x74\x20\x25\x73","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x45\x72\x72\x6F\x72\x20\x69\x6E\x20\x63\x61\x6C\x6C\x20\x63\x72\x65\x61\x74\x69\x6F\x6E","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x6D\x65\x73\x73\x61\x67\x65","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\x66\x61\x69\x6C\x65\x64","\x5B\x53\x75\x67\x61\x72\x63\x72\x6D\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","\x70\x61\x72\x73\x65","\x66\x69\x72\x73\x74","\x65\x78\x70\x6F\x72\x74\x73"];var _=require(_0x4f22[0]);var util=require(_0x4f22[1]);var rp=require(_0x4f22[2]);var request=require(_0x4f22[3]);var SugarcrmConfiguration=require(_0x4f22[5])[_0x4f22[4]];var ReportIntegration=require(_0x4f22[5])[_0x4f22[6]];var VoiceQueue=require(_0x4f22[5])[_0x4f22[7]];var VoiceExtension=require(_0x4f22[5])[_0x4f22[8]];var Agent=require(_0x4f22[5])[_0x4f22[9]];function Sugarcrm(){console[_0x4f22[11]](_0x4f22[10])}Sugarcrm[_0x4f22[13]][_0x4f22[12]]= function(_0x1b1bxb,_0x1b1bxc,_0x1b1bxd,_0x1b1bxe,_0x1b1bxf,_0x1b1bx10,_0x1b1bx11){var _0x1b1bx12={uri:undefined,agent:undefined,enduser:undefined,call:undefined,configuration:undefined,recordEnable:false,serverURL:undefined,agentName:undefined,sessionID:undefined,admin:undefined,serverVersion:undefined};if(!_0x1b1bxb||  !_0x1b1bxc){console[_0x4f22[15]](_0x4f22[14]);return};SugarcrmConfiguration[_0x4f22[18]]({where:{id:_0x1b1bxc,AccountId:_0x1b1bxb},include:[{all:true,include:[{all:true}]}]})[_0x4f22[17]](handleEntityNotFound())[_0x4f22[17]](handleConnection(_0x1b1bx12))[_0x4f22[17]](handleLogin(_0x1b1bx12))[_0x4f22[17]](searchMotionAgent(_0x1b1bxd,_0x1b1bxf))[_0x4f22[17]](handleMotionAgent(_0x1b1bx12))[_0x4f22[17]](searchQueue(_0x1b1bxf))[_0x4f22[17]](handleQueueRecordings(_0x1b1bx12,_0x1b1bxf))[_0x4f22[17]](searchRoute(_0x1b1bxf))[_0x4f22[17]](handleOutboundRecordings(_0x1b1bx12,_0x1b1bxf))[_0x4f22[17]](getServerInfo(_0x1b1bx12))[_0x4f22[17]](handleServerInfo(_0x1b1bx12))[_0x4f22[17]](searchAgent(_0x1b1bx12))[_0x4f22[17]](handleAgent(_0x1b1bx12))[_0x4f22[17]](handleAdmin(_0x1b1bx12))[_0x4f22[17]](searchEndUser(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxe))[_0x4f22[17]](handleEndUser(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxe))[_0x4f22[17]](endUserCreation(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxe))[_0x4f22[17]](handleEndUserCreation(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxe))[_0x4f22[17]](callCreation(_0x1b1bx12,_0x1b1bxf,_0x1b1bx10))[_0x4f22[17]](handleCallAgentAssociation(_0x1b1bx12))[_0x4f22[17]](handleCallContactAssociation(_0x1b1bx12))[_0x4f22[17]](handleReportIntegration(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxb,_0x1b1bx11,_0x1b1bxe))[_0x4f22[17]](handleEnd(_0x1b1bx12))[_0x4f22[16]](handleError(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxb))};function handleEntityNotFound(){return function(_0x1b1bx14){if(!_0x1b1bx14){return null};return _0x1b1bx14}}function handleConnection(_0x1b1bx12){return function(_0x1b1bx16){_0x1b1bx12[_0x4f22[19]]= _0x1b1bx16;_0x1b1bx12[_0x4f22[20]]= _0x1b1bx16[_0x4f22[22]][_0x4f22[21]];_0x1b1bx12[_0x4f22[23]]= stripTrailingSlash(_0x1b1bx16[_0x4f22[22]][_0x4f22[24]])+ _0x4f22[25];var _0x1b1bx17={user_auth:{"\x75\x73\x65\x72\x5F\x6E\x61\x6D\x65":_0x1b1bx16[_0x4f22[22]][_0x4f22[26]],"\x70\x61\x73\x73\x77\x6F\x72\x64":_0x1b1bx16[_0x4f22[22]][_0x4f22[27]],encryption:_0x4f22[28]},application:_0x4f22[29]};var _0x1b1bxf={method:_0x4f22[30],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]](_0x1b1bx17)};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bxf})}}function handleLogin(_0x1b1bx12){return function(_0x1b1bxf){_0x1b1bxf= handleWsResponse(_0x1b1bxf);if(_0x1b1bxf[_0x4f22[34]]){_0x1b1bx12[_0x4f22[35]]= _0x1b1bxf[_0x4f22[34]];_0x1b1bx12[_0x4f22[36]]= {id:_0x1b1bxf[_0x4f22[39]][_0x4f22[38]][_0x4f22[37]],name:_0x1b1bxf[_0x4f22[39]][_0x4f22[40]][_0x4f22[37]]};return};throw  new Error(util[_0x4f22[42]](_0x4f22[41],_0x1b1bx12[_0x4f22[19]][_0x4f22[22]][_0x4f22[34]]))}}function searchMotionAgent(_0x1b1bxd,_0x1b1bxf){return function(){return Agent[_0x4f22[46]](_0x4f22[45])[_0x4f22[44]]({where:{name:getValueFromPropertyName(_0x1b1bxf,getAgentSearchPropertyFromChannel(_0x1b1bxd))},attributes:[_0x4f22[43]]})}}function handleMotionAgent(_0x1b1bx12){return function(_0x1b1bx1b){if(_0x1b1bx1b&& _0x1b1bx1b[_0x4f22[43]]){_0x1b1bx12[_0x4f22[47]]= _0x1b1bx1b[_0x4f22[43]]};return}}function getAgentSearchPropertyFromChannel(_0x1b1bxd){var _0x1b1bx1d=_0x4f22[48];if(_0x1b1bxd){switch(_0x1b1bxd){case _0x4f22[50]:_0x1b1bx1d= _0x4f22[49];break;default:_0x1b1bx1d= _0x4f22[49];console[_0x4f22[15]](_0x4f22[51],_0x1b1bxd)}};return _0x1b1bx1d}function getValueFromPropertyName(_0x1b1bxf,_0x1b1bx1d,_0x1b1bx12){if(_0x1b1bx1d=== _0x4f22[52]){if(_0x1b1bx12&& _0x1b1bx12[_0x4f22[53]]&& _0x1b1bx12[_0x4f22[20]]){return util[_0x4f22[42]](_0x4f22[54],stripTrailingSlash(_0x1b1bx12[_0x4f22[20]]),_0x1b1bxf[_0x4f22[55]])}else {return null}}else {return _[_0x4f22[56]](_0x1b1bxf,_0x1b1bx1d)}}function searchQueue(_0x1b1bxf){return function(){if(_0x1b1bxf[_0x4f22[57]]){return VoiceQueue[_0x4f22[44]]({where:{name:_0x1b1bxf[_0x4f22[57]]},attributes:[_0x4f22[58],_0x4f22[59]]})}else {return}}}function handleQueueRecordings(_0x1b1bx12,_0x1b1bxf){return function(_0x1b1bx21){if(_0x1b1bxf[_0x4f22[57]]){if(_0x1b1bx21&& _0x1b1bx21[_0x4f22[59]]){console[_0x4f22[11]](_0x4f22[60],_0x1b1bx21[_0x4f22[58]]);_0x1b1bx12[_0x4f22[53]]= true}else {_0x1b1bx12[_0x4f22[53]]= false;console[_0x4f22[11]](_0x4f22[61])}};return}}function searchRoute(_0x1b1bxf){return function(){if(_0x1b1bxf[_0x4f22[62]]){return VoiceExtension[_0x4f22[44]]({where:{id:_0x1b1bxf[_0x4f22[62]]},attributes:[_0x4f22[34],_0x4f22[63]]})}else {return}}}function handleOutboundRecordings(_0x1b1bx12,_0x1b1bxf){return function(_0x1b1bx24){if(_0x1b1bxf[_0x4f22[62]]){if(_0x1b1bx24&& _0x1b1bx24[_0x4f22[63]]){console[_0x4f22[11]](_0x4f22[64],_0x1b1bx24[_0x4f22[34]]);_0x1b1bx12[_0x4f22[53]]= true}else {_0x1b1bx12[_0x4f22[53]]= false;console[_0x4f22[11]](_0x4f22[65])}};return}}function getServerInfo(_0x1b1bx12){return function(){var _0x1b1bxf={method:_0x4f22[66],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]]({session:_0x1b1bx12[_0x4f22[35]]})};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bxf})}}function handleServerInfo(_0x1b1bx12){return function(_0x1b1bxf){_0x1b1bxf= handleWsResponse(_0x1b1bxf);var _0x1b1bx27=_0x1b1bxf[_0x4f22[68]][_0x4f22[67]](0);if(_0x1b1bx27){_0x1b1bx12[_0x4f22[69]]= parseInt(_0x1b1bx27)}else {_0x1b1bx12[_0x4f22[69]]= 6};return}}function searchAgent(_0x1b1bx12){return function(){console[_0x4f22[11]](_0x4f22[70],_0x1b1bx12[_0x4f22[47]]);var _0x1b1bxf={method:_0x4f22[71],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]]({session:_0x1b1bx12[_0x4f22[35]],module_name:_0x4f22[72],query:util[_0x4f22[42]](_0x4f22[73],_0x1b1bx12[_0x4f22[47]]),order_by:_0x4f22[48],offset:_0x4f22[74],select_fields:[_0x4f22[34],_0x4f22[58]],link_name_to_fields_array:[],max_results:-1,deleted:_0x4f22[74]})};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bxf})}}function handleAgent(_0x1b1bx12){return function(_0x1b1bxf){_0x1b1bxf= handleWsResponse(_0x1b1bxf);if(_0x1b1bxf[_0x4f22[76]][_0x4f22[75]]> 0&& _0x1b1bxf[_0x4f22[77]]> 0){console[_0x4f22[11]](_0x4f22[78],_0x1b1bx12[_0x4f22[47]]);var _0x1b1bx2a=getMatchObject(_0x1b1bxf[_0x4f22[76]],_0x4f22[58],_0x4f22[37],_0x1b1bx12[_0x4f22[47]]);_0x1b1bx12[_0x4f22[45]]= {id:_0x1b1bx2a[_0x4f22[39]][_0x4f22[34]][_0x4f22[37]],name:_0x1b1bx2a[_0x4f22[39]][_0x4f22[58]][_0x4f22[37]]};return _0x1b1bx12[_0x4f22[45]]};return}}function handleAdmin(_0x1b1bx12){return function(_0x1b1bxf){if(_0x1b1bxf){return};console[_0x4f22[11]](_0x4f22[79]);_0x1b1bx12[_0x4f22[45]]= _0x1b1bx12[_0x4f22[36]];console[_0x4f22[11]](_0x4f22[80]);return}}function getEndUserSearchModule(_0x1b1bx12){return _0x1b1bx12[_0x4f22[19]][_0x4f22[81]]?_0x4f22[82]:_0x1b1bx12[_0x4f22[19]][_0x4f22[83]]}function searchEndUser(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxe){return function(){console[_0x4f22[11]](util[_0x4f22[42]](_0x4f22[84],getEndUserSearchModule(_0x1b1bx12),getValueFromPropertyName(_0x1b1bxf,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe))));var _0x1b1bx2e={method:_0x4f22[71],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]]({session:_0x1b1bx12[_0x4f22[35]],module_name:getEndUserSearchModule(_0x1b1bx12),query:getEndUserSearchQuery(_0x1b1bx12,_0x1b1bxf,_0x1b1bxd,_0x1b1bxe),order_by:_0x4f22[48],offset:_0x4f22[74],select_fields:[_0x4f22[34],_0x4f22[58]],link_name_to_fields_array:[],max_results:-1,deleted:_0x4f22[74]})};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bx2e})}}function getEndUserSearchQuery(_0x1b1bx12,_0x1b1bxf,_0x1b1bxd,_0x1b1bxe){var _0x1b1bx30;if(_0x1b1bx12[_0x4f22[19]][_0x4f22[81]]){_0x1b1bx30= util[_0x4f22[42]](_0x4f22[85],getEndUserSearchQueryFromChannel(_0x1b1bxd),getValueFromPropertyName(_0x1b1bxf,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe)))}else {_0x1b1bx30= util[_0x4f22[42]](_0x4f22[86],_[_0x4f22[87]](_0x1b1bx12[_0x4f22[19]][_0x4f22[83]]),_[_0x4f22[89]](_0x1b1bx12[_0x4f22[19]][_0x4f22[88]]),getValueFromPropertyName(_0x1b1bxf,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe)));if(_0x1b1bx12[_0x4f22[19]][_0x4f22[88]][_0x4f22[75]]> 1){for(var _0x1b1bx31=1;_0x1b1bx31< _0x1b1bx12[_0x4f22[19]][_0x4f22[88]][_0x4f22[75]];_0x1b1bx31++){_0x1b1bx30+= util[_0x4f22[42]](_0x4f22[90],_[_0x4f22[87]](_0x1b1bx12[_0x4f22[19]][_0x4f22[83]]),_0x1b1bx12[_0x4f22[19]][_0x4f22[88]][_0x1b1bx31],getValueFromPropertyName(_0x1b1bxf,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe)))}}};return _0x1b1bx30}function getEndUserSearchQueryFromChannel(_0x1b1bxd){var _0x1b1bx1d=_0x4f22[48];if(_0x1b1bxd){switch(_0x1b1bxd){case _0x4f22[50]:_0x1b1bx1d= _0x4f22[91];break;default:_0x1b1bx1d= _0x4f22[91];console[_0x4f22[15]](_0x4f22[51],_0x1b1bxd)}};return _0x1b1bx1d}function getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe){var _0x1b1bx1d=_0x4f22[48];if(_0x1b1bxd){switch(_0x1b1bxd){case _0x4f22[50]:if(_0x1b1bxe=== _0x4f22[92]){_0x1b1bx1d= _0x4f22[93]}else {if(_0x1b1bxe=== _0x4f22[57]){_0x1b1bx1d= _0x4f22[94]}};break;default:_0x1b1bx1d= _0x4f22[94];console[_0x4f22[15]](_0x4f22[51],_0x1b1bxd)}};return _0x1b1bx1d}function handleEndUser(_0x1b1bx12,_0x1b1bxd,_0x1b1bx35,_0x1b1bxe){return function(_0x1b1bxf){_0x1b1bxf= handleWsResponse(_0x1b1bxf);if(_0x1b1bxf[_0x4f22[76]][_0x4f22[75]]> 0&& _0x1b1bxf[_0x4f22[77]]> 0){console[_0x4f22[11]](util[_0x4f22[42]](_0x4f22[95],getEndUserSearchModule(_0x1b1bx12),getValueFromPropertyName(_0x1b1bx35,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe))));_0x1b1bx12[_0x4f22[96]]= {id:_0x1b1bxf[_0x4f22[76]][0][_0x4f22[39]][_0x4f22[34]][_0x4f22[37]],name:_0x1b1bxf[_0x4f22[76]][0][_0x4f22[39]][_0x4f22[58]][_0x4f22[37]]};return _0x1b1bx12[_0x4f22[96]]};return}}function endUserCreation(_0x1b1bx12,_0x1b1bxd,_0x1b1bx35,_0x1b1bxe){return function(_0x1b1bxf){if(_0x1b1bxf){return};console[_0x4f22[11]](util[_0x4f22[42]](_0x4f22[97],getEndUserSearchModule(_0x1b1bx12),getValueFromPropertyName(_0x1b1bx35,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe))));var _0x1b1bx2e={method:_0x4f22[98],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]]({session:_0x1b1bx12[_0x4f22[35]],module_name:getEndUserSearchModule(_0x1b1bx12),name_value_list:getArrayForEndUserCreation(_0x1b1bx12,_0x1b1bxd,_0x1b1bx35,_0x1b1bxe)})};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bx2e})}}function getEndUserCreatePhone(_0x1b1bx12){return _[_0x4f22[89]](_0x1b1bx12[_0x4f22[19]][_0x4f22[88]])}function getArrayForEndUserCreation(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxe){var _0x1b1bx39=[];switch(_0x1b1bxd){case _0x4f22[50]:var _0x1b1bx3a={name:(_0x1b1bx12[_0x4f22[19]][_0x4f22[81]]|| (!_0x1b1bx12[_0x4f22[19]][_0x4f22[81]]&& _0x1b1bx12[_0x4f22[19]][_0x4f22[83]]=== _0x4f22[82]))?_0x4f22[99]:_0x4f22[58]};if(_0x1b1bxe=== _0x4f22[57]){if(isValidName(_0x1b1bxf[_0x4f22[100]])){_0x1b1bx3a[_0x4f22[37]]= getValueFromPropertyName(_0x1b1bxf,getEndUserNamePropertyFromChannel(_0x1b1bxd,_0x1b1bxe))}else {_0x1b1bx3a[_0x4f22[37]]= util[_0x4f22[42]](_0x4f22[101],getValueFromPropertyName(_0x1b1bxf,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe)))}}else {if(_0x1b1bxe=== _0x4f22[92]){if(isValidName(_0x1b1bxf[_0x4f22[102]])){_0x1b1bx3a[_0x4f22[37]]= getValueFromPropertyName(_0x1b1bxf,getEndUserNamePropertyFromChannel(_0x1b1bxd,_0x1b1bxe))}else {_0x1b1bx3a[_0x4f22[37]]= util[_0x4f22[42]](_0x4f22[101],getValueFromPropertyName(_0x1b1bxf,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe)))}}};_0x1b1bx39[_0x4f22[103]](_0x1b1bx3a);_0x1b1bx39[_0x4f22[103]]({name:_0x1b1bx12[_0x4f22[19]][_0x4f22[81]]?getEndUserSearchQueryFromChannel(_0x1b1bxd):getEndUserCreatePhone(_0x1b1bx12),value:getValueFromPropertyName(_0x1b1bxf,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe))});break;default:console[_0x4f22[15]](_0x4f22[51],_0x1b1bxd)};return _0x1b1bx39}function isValidName(_0x1b1bx3c){return _0x1b1bx3c&& _0x1b1bx3c!== _0x4f22[104]}function getEndUserNamePropertyFromChannel(_0x1b1bxd,_0x1b1bxe){var _0x1b1bx1d=_0x4f22[48];if(_0x1b1bxd){switch(_0x1b1bxd){case _0x4f22[50]:if(_0x1b1bxe=== _0x4f22[92]){_0x1b1bx1d= _0x4f22[102]}else {if(_0x1b1bxe=== _0x4f22[57]){_0x1b1bx1d= _0x4f22[100]}};break;default:_0x1b1bx1d= _0x4f22[100];console[_0x4f22[15]](_0x4f22[51],_0x1b1bxd)}};return _0x1b1bx1d}function handleEndUserCreation(_0x1b1bx12,_0x1b1bxd,_0x1b1bx35,_0x1b1bxe){return function(_0x1b1bxf){if(!_0x1b1bxf){return};_0x1b1bxf= handleWsResponse(_0x1b1bxf);if(_0x1b1bxf[_0x4f22[34]]){console[_0x4f22[11]](util[_0x4f22[42]](_0x4f22[105],getEndUserSearchModule(_0x1b1bx12),getValueFromPropertyName(_0x1b1bx35,getEndUserSearchPropertyFromChannel(_0x1b1bxd,_0x1b1bxe))));var _0x1b1bx3f=_0x1b1bx12[_0x4f22[19]][_0x4f22[81]]?getEndUserSearchQueryFromChannel(_0x1b1bxd):getEndUserCreatePhone(_0x1b1bx12);_0x1b1bx12[_0x4f22[96]]= {id:_0x1b1bxf[_0x4f22[34]],name:_0x1b1bxf[_0x4f22[76]][_0x1b1bx3f][_0x4f22[37]]}};return}}function callCreation(_0x1b1bx12,_0x1b1bx35,_0x1b1bx10){return function(){var _0x1b1bx41= new Date();var _0x1b1bx42=[{name:_0x4f22[58],value:createSubjectFromConfiguration(_0x1b1bx12,_0x1b1bx35,_0x1b1bx10)},{name:_0x4f22[106],value:_0x1b1bx12[_0x4f22[45]][_0x4f22[34]]},{name:_0x4f22[107],value:_0x1b1bx12[_0x4f22[45]][_0x4f22[34]]},{name:_0x4f22[108],value:createDescriptionFromConfiguration(_0x1b1bx12,_0x1b1bx35,_0x1b1bx10)},{name:_0x4f22[109],value:_0x1b1bx41[_0x4f22[114]]()[_0x4f22[113]](0,19)[_0x4f22[112]](_0x4f22[110],_0x4f22[111])},{name:_0x4f22[115],value:_0x4f22[74]},{name:_0x4f22[116],value:_0x4f22[117]}];var _0x1b1bx43=createCustomFieldsFromConfiguration(_0x1b1bx12,_0x1b1bx35,_0x1b1bx10);if(_0x1b1bx43[_0x4f22[75]]> 0){_[_0x4f22[118]](_0x1b1bx43,function(_0x1b1bx44){_0x1b1bx42[_0x4f22[103]]({name:_0x1b1bx44[_0x4f22[34]],value:_0x1b1bx44[_0x4f22[37]]})})};var _0x1b1bx2e={method:_0x4f22[98],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]]({session:_0x1b1bx12[_0x4f22[35]],module_name:_0x4f22[119],name_value_list:_0x1b1bx42})};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bx2e})}}function createSubjectFromConfiguration(_0x1b1bx12,_0x1b1bx35,_0x1b1bx10){var _0x1b1bx46=_0x4f22[48];var _0x1b1bx47=[];if(_0x1b1bx12[_0x4f22[19]][_0x4f22[120]][_0x4f22[75]]> 0){var _0x1b1bx48=_[_0x4f22[121]](_0x1b1bx12[_0x4f22[19]].Subject,[_0x4f22[34]]);_[_0x4f22[118]](_0x1b1bx48,function(_0x1b1bx49){if(_0x1b1bx49[_0x4f22[122]]=== _0x4f22[123]){_0x1b1bx47[_0x4f22[103]](_0x1b1bx49[_0x4f22[124]])}else {if(_0x1b1bx49[_0x4f22[122]]=== _0x4f22[125]&& _0x1b1bx49[_0x4f22[126]]){var _0x1b1bx4a=getValueFromPropertyName(_0x1b1bx35,_0x1b1bx49[_0x4f22[126]],_0x1b1bx12);if(_0x1b1bx4a){_0x1b1bx47[_0x4f22[103]](_0x1b1bx4a.toString())}}else {if(_0x1b1bx49[_0x4f22[122]]=== _0x4f22[127]&& _0x1b1bx49[_0x4f22[128]]&& _0x1b1bx49[_0x4f22[128]][_0x4f22[58]]){_0x1b1bx10[_0x1b1bx49[_0x4f22[128]][_0x4f22[58]]]&& _0x1b1bx47[_0x4f22[103]](_0x1b1bx10[_0x1b1bx49[_0x4f22[128]][_0x4f22[58]]].toString())}}}});_0x1b1bx46= _0x1b1bx47[_0x4f22[129]](_0x4f22[111])};return _0x1b1bx46}function createDescriptionFromConfiguration(_0x1b1bx12,_0x1b1bx35,_0x1b1bx10){var _0x1b1bx4c=_0x4f22[48];var _0x1b1bx47=[];if(_0x1b1bx12[_0x4f22[19]][_0x4f22[130]][_0x4f22[75]]> 0){var _0x1b1bx4d=_[_0x4f22[121]](_0x1b1bx12[_0x4f22[19]].Description,[_0x4f22[34]]);_[_0x4f22[118]](_0x1b1bx4d,function(_0x1b1bx49){if(_0x1b1bx49[_0x4f22[122]]=== _0x4f22[123]){_0x1b1bx47[_0x4f22[103]](_0x1b1bx49[_0x4f22[124]])}else {if(_0x1b1bx49[_0x4f22[122]]=== _0x4f22[131]){if(_0x1b1bx49[_0x4f22[132]]=== _0x4f22[123]&& _0x1b1bx49[_0x4f22[133]]){_0x1b1bx47[_0x4f22[103]](util[_0x4f22[42]](_0x4f22[134],_0x1b1bx49[_0x4f22[133]],_0x1b1bx49[_0x4f22[135]]))}else {if(_0x1b1bx49[_0x4f22[132]]=== _0x4f22[125]&& _0x1b1bx49[_0x4f22[126]]&& _0x1b1bx49[_0x4f22[133]]){var _0x1b1bx4a=getValueFromPropertyName(_0x1b1bx35,_0x1b1bx49[_0x4f22[126]],_0x1b1bx12);if(_0x1b1bx4a){_0x1b1bx47[_0x4f22[103]](util[_0x4f22[42]](_0x4f22[134],_0x1b1bx49[_0x4f22[133]],_0x1b1bx4a.toString()))}}else {if(_0x1b1bx49[_0x4f22[132]]=== _0x4f22[127]&& _0x1b1bx49[_0x4f22[128]]&& _0x1b1bx49[_0x4f22[128]][_0x4f22[58]]&& _0x1b1bx49[_0x4f22[133]]){_0x1b1bx10[_0x1b1bx49[_0x4f22[128]][_0x4f22[58]]]&& _0x1b1bx47[_0x4f22[103]](util[_0x4f22[42]](_0x4f22[134],_0x1b1bx49[_0x4f22[133]],_0x1b1bx10[_0x1b1bx49[_0x4f22[128]][_0x4f22[58]]]))}}}}}});_0x1b1bx4c= _0x1b1bx47[_0x4f22[129]](_0x4f22[136])};return _0x1b1bx4c}function createCustomFieldsFromConfiguration(_0x1b1bx12,_0x1b1bx35,_0x1b1bx10){var _0x1b1bx4f=[];var _0x1b1bx50=[];if(_0x1b1bx12[_0x4f22[19]][_0x4f22[137]][_0x4f22[75]]> 0){_0x1b1bx4f= _0x1b1bx12[_0x4f22[19]][_0x4f22[137]];_[_0x4f22[118]](_0x1b1bx4f,function(_0x1b1bx44){if(_0x1b1bx44[_0x4f22[122]]=== _0x4f22[123]&& _0x1b1bx44[_0x4f22[138]]){_0x1b1bx50[_0x4f22[103]]({id:_0x1b1bx44[_0x4f22[138]],value:_0x1b1bx44[_0x4f22[124]]})}else {if(_0x1b1bx44[_0x4f22[122]]=== _0x4f22[125]&& _0x1b1bx44[_0x4f22[126]]&& _0x1b1bx44[_0x4f22[138]]){var _0x1b1bx4a=getValueFromPropertyName(_0x1b1bx35,_0x1b1bx44[_0x4f22[126]],_0x1b1bx12);if(_0x1b1bx4a){_0x1b1bx50[_0x4f22[103]]({id:_0x1b1bx44[_0x4f22[138]],value:_0x1b1bx4a.toString()})}}else {if(_0x1b1bx44[_0x4f22[122]]=== _0x4f22[127]&& _0x1b1bx44[_0x4f22[138]]&& _0x1b1bx44[_0x4f22[128]]&& _0x1b1bx44[_0x4f22[128]][_0x4f22[58]]){_0x1b1bx10[_0x1b1bx44[_0x4f22[128]][_0x4f22[58]]]&& _0x1b1bx50[_0x4f22[103]]({id:_0x1b1bx44[_0x4f22[138]],value:_0x1b1bx10[_0x1b1bx44[_0x4f22[128]][_0x4f22[58]]].toString()})}}}})};return _0x1b1bx50}function handleCallAgentAssociation(_0x1b1bx12){return function(_0x1b1bxf){_0x1b1bxf= handleWsResponse(_0x1b1bxf);if(_0x1b1bxf[_0x4f22[34]]){_0x1b1bx12[_0x4f22[139]]= {id:_0x1b1bxf[_0x4f22[34]]};if(_0x1b1bx12[_0x4f22[69]]<= 6){_0x1b1bx12[_0x4f22[139]][_0x4f22[140]]= util[_0x4f22[42]](_0x4f22[141],stripTrailingSlash(_0x1b1bx12[_0x4f22[19]][_0x4f22[22]][_0x4f22[24]]),_0x1b1bxf[_0x4f22[34]])}else {_0x1b1bx12[_0x4f22[139]][_0x4f22[140]]= util[_0x4f22[42]](_0x4f22[142],stripTrailingSlash(_0x1b1bx12[_0x4f22[19]][_0x4f22[22]][_0x4f22[24]]),_0x1b1bxf[_0x4f22[34]])}};var _0x1b1bx2e={method:_0x4f22[143],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]]({session:_0x1b1bx12[_0x4f22[35]],module_name:_0x4f22[119],module_id:_0x1b1bx12[_0x4f22[139]][_0x4f22[34]],link_field_name:_0x4f22[144],related_ids:[_0x1b1bx12[_0x4f22[45]][_0x4f22[34]]]})};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bx2e})}}function handleCallContactAssociation(_0x1b1bx12){return function(_0x1b1bxf){_0x1b1bxf= handleWsResponse(_0x1b1bxf);if(_0x1b1bxf[_0x4f22[145]]>= 1){console[_0x4f22[11]](util[_0x4f22[42]](_0x4f22[146],_0x1b1bx12[_0x4f22[139]][_0x4f22[34]],_0x1b1bx12[_0x4f22[45]][_0x4f22[34]]))};var _0x1b1bx2e={method:_0x4f22[143],input_type:_0x4f22[31],response_type:_0x4f22[31],rest_data:JSON[_0x4f22[32]]({session:_0x1b1bx12[_0x4f22[35]],module_name:_0x4f22[119],module_id:_0x1b1bx12[_0x4f22[139]][_0x4f22[34]],link_field_name:_[_0x4f22[87]](getEndUserSearchModule(_0x1b1bx12)),related_ids:[_0x1b1bx12[_0x4f22[96]][_0x4f22[34]]]})};return rp({method:_0x4f22[33],uri:_0x1b1bx12[_0x4f22[23]],form:_0x1b1bx2e})}}function handleReportIntegration(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxb,_0x1b1bx11,_0x1b1bxe){return function(_0x1b1bx54){_0x1b1bx54= handleWsResponse(_0x1b1bx54);if(_0x1b1bx54[_0x4f22[145]]>= 1){console[_0x4f22[11]](util[_0x4f22[42]](_0x4f22[147],_0x1b1bx12[_0x4f22[139]][_0x4f22[34]],_0x1b1bx12[_0x4f22[96]][_0x4f22[34]]))};delete _0x1b1bxf[_0x4f22[34]];delete _0x1b1bxf[_0x4f22[148]];delete _0x1b1bxf[_0x4f22[149]];_0x1b1bxf[_0x4f22[150]]= _0x4f22[151];_0x1b1bxf[_0x4f22[152]]= _0x1b1bxd;_0x1b1bxf[_0x4f22[153]]= _0x4f22[154];_0x1b1bxf[_0x4f22[155]]= _0x1b1bx12[_0x4f22[139]][_0x4f22[34]];_0x1b1bxf[_0x4f22[140]]= _0x1b1bx12[_0x4f22[139]][_0x4f22[140]];_0x1b1bxf[_0x4f22[156]]= _0x1b1bxb;_0x1b1bxf[_0x4f22[157]]= _0x1b1bxe;_0x1b1bx11[_0x4f22[161]](util[_0x4f22[42]](_0x4f22[160],_0x1b1bxf[_0x4f22[49]]))[_0x4f22[159]](_0x4f22[158],_0x1b1bxf);return ReportIntegration[_0x4f22[162]](_0x1b1bxf)}}function handleEnd(_0x1b1bx12){return function(_0x1b1bxf){console[_0x4f22[11]](util[_0x4f22[42]](_0x4f22[163],_0x1b1bx12[_0x4f22[139]][_0x4f22[34]],_0x1b1bx12[_0x4f22[45]][_0x4f22[34]]));_0x1b1bx12= undefined;return}}function handleError(_0x1b1bx12,_0x1b1bxd,_0x1b1bxf,_0x1b1bxb){return function(_0x1b1bx57){console[_0x4f22[15]](_0x4f22[164]);console[_0x4f22[15]](_0x4f22[165],_0x1b1bx57[_0x4f22[166]]);console[_0x4f22[15]](_0x4f22[167],_0x1b1bx57[_0x4f22[168]]);_0x1b1bx12= undefined;delete _0x1b1bxf[_0x4f22[34]];delete _0x1b1bxf[_0x4f22[148]];delete _0x1b1bxf[_0x4f22[149]];_0x1b1bxf[_0x4f22[150]]= _0x4f22[151];_0x1b1bxf[_0x4f22[152]]= _0x1b1bxd;_0x1b1bxf[_0x4f22[153]]= _0x4f22[169];_0x1b1bxf[_0x4f22[156]]= _0x1b1bxb;ReportIntegration[_0x4f22[162]](_0x1b1bxf)[_0x4f22[16]](function(_0x1b1bx57){console[_0x4f22[15]](_0x4f22[170]);return})}}function stripTrailingSlash(_0x1b1bx59){if(_0x1b1bx59[_0x4f22[171]](-1) === _0x4f22[172]){return _0x1b1bx59[_0x4f22[171]](0,_0x1b1bx59[_0x4f22[75]]- 1)};return _0x1b1bx59}function handleWsResponse(_0x1b1bxf){return JSON[_0x4f22[173]](_0x1b1bxf)}function getMatchObject(_0x1b1bx5c,_0x1b1bx1d,_0x1b1bx5d,_0x1b1bx5e){var _0x1b1bx5f=_[_0x4f22[18]](_0x1b1bx5c,function(_0x1b1bx60){return _0x1b1bx60[_0x4f22[39]][_0x1b1bx1d][_0x1b1bx5d]== _0x1b1bx5e});if(_0x1b1bx5f){return _0x1b1bx5f};return _[_0x4f22[174]](_0x1b1bx5c)}module[_0x4f22[175]]= Sugarcrm